2021-09-19 23:06:09 +00:00
|
|
|
import { skipVotes } from "../../utils/soundplayer.js";
|
|
|
|
import MusicCommand from "../../classes/musicCommand.js";
|
|
|
|
|
|
|
|
class ForceSkipCommand extends MusicCommand {
|
|
|
|
async run() {
|
|
|
|
if (!this.message.channel.guild) return "This command only works in servers!";
|
|
|
|
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
|
|
|
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
|
|
|
if (!this.message.member.permissions.has("manageChannels")) return "You need to have the `Manage Channels` permission to force skip!";
|
|
|
|
this.connection.player.stop(this.message.channel.guild.id);
|
2021-10-08 04:58:24 +00:00
|
|
|
skipVotes.set(this.message.channel.guild.id, { count: 0, ids: [], max: Math.min(3, this.connection.voiceChannel.voiceMembers.filter((i) => i.id !== this.client.user.id && !i.bot).length) });
|
2021-09-19 23:06:09 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static description = "Force skips the current song";
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ForceSkipCommand;
|