forceskip

This commit is contained in:
Lukáš Horáček 2020-04-12 11:24:58 +02:00
parent 8e850b1adf
commit 818a923a37
No known key found for this signature in database
GPG key ID: E07D6630DBC17195
2 changed files with 30 additions and 0 deletions

22
commands/forceskip.js Normal file
View file

@ -0,0 +1,22 @@
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: 'Moderator',
requiredPerms: [],
cooldown: 2000
}
exports.help = {
name: 'forceskip',
category: 'Music',
description: 'Force skips currently playing song.',
usage: 'forceskip',
params: ''
}
exports.run = async (client, message, args, level, data) => {
client.music.skip(message.guild, 'forceskip');
message.reply('skipped currently playing music');
};

View file

@ -162,4 +162,12 @@ module.exports = client => {
g.dispatcher.setVolume(target); g.dispatcher.setVolume(target);
}; };
}; };
client.music.skip = function(guild, reason) {
let g = client.music.getGuild(guild.id);
if(g.dispatcher) {
g.dispatcher.end(reason);
};
};
} }