diff options
Diffstat (limited to 'AudioBackend.js')
| -rw-r--r-- | AudioBackend.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/AudioBackend.js b/AudioBackend.js index e3e31cc..6507716 100644 --- a/AudioBackend.js +++ b/AudioBackend.js @@ -111,4 +111,19 @@ export function destroyAudio(interaction) { player.stop(); const connection = getVoiceConnection(interaction.guild.id); connection.destroy(); +} + +export async function stopBot(bot, interaction) { + const statusEmbed = new MessageEmbed() + .setAuthor({name: bot.user.username, iconURL: bot.user.avatarURL()}) + .setDescription(`That\'s all folks! Powering down ${bot.user.username}...`) + .setColor('#0066ff') + let statusChannel = bot.channels.cache.get(config.statusChannel); + if (!statusChannel) return console.error('The status channel does not exist! Skipping.'); + await statusChannel.send({embeds: [statusEmbed]}); + + console.log('Powering off...'); + destroyAudio(interaction); + bot.destroy(); + process.exit(0); }
\ No newline at end of file |
