diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2022-12-20 17:54:56 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2022-12-20 18:05:51 -0500 |
| commit | e5c86859e4c6a9a6829bcc2e3cf626b05a873ff7 (patch) | |
| tree | 96c04baa3f064a160a595a0faf73696cc5cf8eaa /Commands/next.js | |
| parent | 239b254760381946f57d6cbccb077f5341ca2f30 (diff) | |
| download | DLAP-e5c86859e4c6a9a6829bcc2e3cf626b05a873ff7.tar.gz DLAP-e5c86859e4c6a9a6829bcc2e3cf626b05a873ff7.tar.bz2 DLAP-e5c86859e4c6a9a6829bcc2e3cf626b05a873ff7.zip | |
Revamped next/previous cmds (Voting system); Basic i18n support;
Diffstat (limited to 'Commands/next.js')
| -rw-r--r-- | Commands/next.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Commands/next.js b/Commands/next.js index d3240cf..f082c89 100644 --- a/Commands/next.js +++ b/Commands/next.js @@ -20,23 +20,21 @@ ***************************************************************************/ import { SlashCommandBuilder } from 'discord.js'; -import { player } from '../AudioBackend/VoiceInitialization.js'; -import { nextAudio, playerState } from '../AudioBackend/AudioControl.js'; -import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { voteSkip } from '../Utilities/Voting.js'; export default { data: new SlashCommandBuilder() .setName('next') .setDescription('Goes to next music') - .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), + .addSubcommand(subcommand => + subcommand.setName('vote') + .setDescription('Voting to skip this audio track')) + .addSubcommand(subcommand => + subcommand.setName('force') + .setDescription('Forces skip this audio track')), + async execute(interaction, bot) { if (!interaction.member.voice.channel) return await interaction.reply({ content: 'You need to be in a voice channel to use this command.', ephemeral: true }); - if (playerState === 'Playing' || playerState === 'Paused') { - await interaction.reply({ content: 'Playing next music', ephemeral: true }); - player.stop(); - return await nextAudio(bot); - } else if (playerState === 'Stopped') { - return await interaction.reply({ content: 'Cannot play next music. Player is currently stopped...', ephemeral: true }); - } + await voteSkip(interaction, bot); } }; |
