aboutsummaryrefslogtreecommitdiff
path: root/AudioBackend.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-03-29 15:44:47 -0400
committerAndrew Lee <alee14498@protonmail.com>2022-03-29 15:44:47 -0400
commit84b7017c7016aea12339ec4a3ef2ba1bf0fb3872 (patch)
tree414728d4cde0e79851e80626b1521fce796913ac /AudioBackend.js
parent18f0b9d60c44f69fad6eb4716659c79f08f46711 (diff)
downloadDLAP-84b7017c7016aea12339ec4a3ef2ba1bf0fb3872.tar.gz
DLAP-84b7017c7016aea12339ec4a3ef2ba1bf0fb3872.tar.bz2
DLAP-84b7017c7016aea12339ec4a3ef2ba1bf0fb3872.zip
"More buttons" almost works; Merging stop functions into one
Diffstat (limited to 'AudioBackend.js')
-rw-r--r--AudioBackend.js15
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