aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/control.js32
-rw-r--r--commands/help.js2
2 files changed, 30 insertions, 4 deletions
diff --git a/commands/control.js b/commands/control.js
index c677f3f..8db425c 100644
--- a/commands/control.js
+++ b/commands/control.js
@@ -21,7 +21,7 @@
import { SlashCommandBuilder } from '@discordjs/builders'
import { MessageEmbed, MessageActionRow, MessageButton } from 'discord.js'
-import { audio } from '../AudioBackend.js'
+import { audio, player, playAudio } from '../AudioBackend.js'
export default {
@@ -38,11 +38,37 @@ export default {
const controlButtons = new MessageActionRow()
.addComponents(
new MessageButton()
+ .setStyle('SUCCESS')
+ .setLabel('Play')
+ .setCustomId('play'),
+ new MessageButton()
.setStyle('PRIMARY')
- .setLabel('Pause')
- .setCustomId('soon')
+ .setLabel('Pause') //possible toggle button instead
+ .setCustomId('pause'),
+ new MessageButton()
+ .setStyle('SECONDARY')
+ .setLabel('Skip')
+ .setCustomId('skip'),
+ new MessageButton()
+ .setStyle('DANGER')
+ .setLabel('Leave')
+ .setCustomId('leave')
);
+ const filter = i => i.customId === 'pause' && i.user.id === '242775871059001344';
+
+ const collector = interaction.channel.createMessageComponentCollector({ filter, time: 15000 });
+
+ collector.on('collect', async i => {
+ if (i.customId === 'pause') {
+ await i.reply({content:'test'})
+ }
+
+ if (i.customId === 'skip') {
+ await i.reply
+ }
+ });
+
return interaction.reply({embeds:[controlEmbed], components:[controlButtons]});
},
}; \ No newline at end of file
diff --git a/commands/help.js b/commands/help.js
index f56715c..76bd29b 100644
--- a/commands/help.js
+++ b/commands/help.js
@@ -30,7 +30,7 @@ export default {
async execute(interaction, bot) {
const helpEmbed = new MessageEmbed()
.setAuthor({name:`${bot.user.username} Help`, iconURL:bot.user.avatarURL()})
- .setDescription(`Currently playing \`${audio}\`.`)
+ .setDescription(`Currently playing \`${audio}\``)
.addField('Public Commands', `/help\n/ping\n/about\n`, true)
.addField('Bot Owner Only', `/join\n/control\n/stop\n`, true)
.setFooter({text:'© Copyright 2020-2022 Andrew Lee. Licensed with GPL-3.0.'})