2022-10-09 17:48:40 +05:00
|
|
|
const { SlashCommandBuilder } = require("discord.js");
|
|
|
|
const BaseCommand = require("../../base/BaseCommand");
|
|
|
|
|
|
|
|
class Shuffle extends BaseCommand {
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {import("../base/JaBa")} client
|
|
|
|
*/
|
|
|
|
constructor(client) {
|
|
|
|
super({
|
|
|
|
command: new SlashCommandBuilder()
|
|
|
|
.setName("shuffle")
|
2022-10-13 00:05:36 +05:00
|
|
|
.setDescription(client.translate("music/shuffle:DESCRIPTION"))
|
|
|
|
.setDMPermission(false),
|
2022-10-09 17:48:40 +05:00
|
|
|
aliases: [],
|
|
|
|
dirname: __dirname,
|
2022-12-15 21:02:38 +05:00
|
|
|
ownerOnly: false,
|
2022-10-09 17:48:40 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {import("../../base/JaBa")} client
|
|
|
|
*/
|
|
|
|
async onLoad() {
|
|
|
|
//...
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {import("../../base/JaBa")} client
|
|
|
|
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
|
|
* @param {Object} data
|
|
|
|
*/
|
|
|
|
async execute(client, interaction) {
|
|
|
|
const voice = interaction.member.voice.channel;
|
|
|
|
if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL", null, { ephemeral: true });
|
2023-01-09 01:39:13 +05:00
|
|
|
|
2022-10-09 17:48:40 +05:00
|
|
|
const queue = client.player.getQueue(interaction.guildId);
|
|
|
|
if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { ephemeral: true });
|
|
|
|
|
2022-11-23 12:38:27 +05:00
|
|
|
queue.shuffle();
|
|
|
|
interaction.success("music/shuffle:SUCCESS");
|
2022-10-09 17:48:40 +05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Shuffle;
|