aboutsummaryrefslogtreecommitdiff
path: root/commands/control.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-03-28 19:53:00 -0400
committerAndrew Lee <alee14498@protonmail.com>2022-03-28 19:53:00 -0400
commit08aae8cd9e5417bd7451b9af2e3190bf9c6a4e43 (patch)
tree965f234d6683b726bddc07ce19914e84b335cd44 /commands/control.js
parent0f5a1a252964861e149a0d784a90f0ad74aa09cb (diff)
downloadDLAP-08aae8cd9e5417bd7451b9af2e3190bf9c6a4e43.tar.gz
DLAP-08aae8cd9e5417bd7451b9af2e3190bf9c6a4e43.tar.bz2
DLAP-08aae8cd9e5417bd7451b9af2e3190bf9c6a4e43.zip
Removed old cmd handler; Brought back join; New cmd
Diffstat (limited to 'commands/control.js')
-rw-r--r--commands/control.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/commands/control.js b/commands/control.js
index 4c8c7a6..b3dd0bf 100644
--- a/commands/control.js
+++ b/commands/control.js
@@ -21,7 +21,9 @@
import { SlashCommandBuilder } from '@discordjs/builders'
import { MessageEmbed, MessageActionRow, MessageButton } from 'discord.js'
-import {audio, player, playAudio, destroyAudio, voiceInit} from '../AudioBackend.js'
+import { audio, player, playAudio, destroyAudio, voiceInit } from '../AudioBackend.js'
+
+import config from '../config.json' assert {type: 'json'}
export default {
data: new SlashCommandBuilder()
@@ -38,7 +40,7 @@ export default {
const controlButtons = new MessageActionRow()
.addComponents(
new MessageButton()
- .setStyle('SUCCESS')
+ .setStyle('SECONDARY')
.setLabel('Join')
.setCustomId('join'),
new MessageButton()
@@ -47,7 +49,7 @@ export default {
.setCustomId('play'),
new MessageButton()
.setStyle('PRIMARY')
- .setLabel('Pause') //possible toggle button instead
+ .setLabel('Pause') //TODO: possibly toggle button instead
.setCustomId('pause'),
new MessageButton()
.setStyle('SECONDARY')
@@ -98,6 +100,7 @@ export default {
}
if (ctlButton.customId === 'stop') {
await ctlButton.reply({content:'Powering off...', ephemeral:true})
+
const statusEmbed = new MessageEmbed()
.setAuthor({name:bot.user.username, iconURL:bot.user.avatarURL()})
.setDescription(`That\'s all folks! Powering down ${bot.user.username}...`)
@@ -105,6 +108,7 @@ export default {
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();