From 84b7017c7016aea12339ec4a3ef2ba1bf0fb3872 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 29 Mar 2022 15:44:47 -0400 Subject: "More buttons" almost works; Merging stop functions into one --- AudioBackend.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'AudioBackend.js') 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 -- cgit v1.2.3