aboutsummaryrefslogtreecommitdiff
path: root/Commands/previous.js
diff options
context:
space:
mode:
Diffstat (limited to 'Commands/previous.js')
-rw-r--r--Commands/previous.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/Commands/previous.js b/Commands/previous.js
index dd79a98..aa732b2 100644
--- a/Commands/previous.js
+++ b/Commands/previous.js
@@ -20,20 +20,20 @@
***************************************************************************/
import { SlashCommandBuilder } from 'discord.js';
-import { playerState, previousAudio } from '../AudioBackend/AudioControl.js';
-import { PermissionFlagsBits } from 'discord-api-types/v10';
+import { voteSkip } from '../Utilities/Voting.js';
export default {
data: new SlashCommandBuilder()
.setName('previous')
.setDescription('Goes to previous 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') {
- return await previousAudio(bot, interaction);
- } else if (playerState === 'Stopped') {
- return await interaction.reply({ content: 'Cannot play next music. Player is currently stopped...', ephemeral: true });
- }
+ await voteSkip(interaction, bot);
}
};