diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2022-03-28 14:25:23 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2022-03-28 14:25:23 -0400 |
| commit | 884e1acf7d3982e66f28dc2cd68e74325f704c6c (patch) | |
| tree | 8c3e97a7a84b4bf72dc25618376216341fcec6fd /commands | |
| parent | 5ae481c84ea8edfd9e5589b331f32f453e6e5431 (diff) | |
| download | DLAP-884e1acf7d3982e66f28dc2cd68e74325f704c6c.tar.gz DLAP-884e1acf7d3982e66f28dc2cd68e74325f704c6c.tar.bz2 DLAP-884e1acf7d3982e66f28dc2cd68e74325f704c6c.zip | |
Added more buttons to control command
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/control.js | 32 | ||||
| -rw-r--r-- | commands/help.js | 2 |
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.'}) |
