diff --git a/commands/forceskip.js b/commands/forceskip.js new file mode 100644 index 0000000..d79a431 --- /dev/null +++ b/commands/forceskip.js @@ -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'); +}; \ No newline at end of file diff --git a/helpers/music.js b/helpers/music.js index cd5cf6b..3077b6a 100644 --- a/helpers/music.js +++ b/helpers/music.js @@ -162,4 +162,12 @@ module.exports = client => { g.dispatcher.setVolume(target); }; }; + + client.music.skip = function(guild, reason) { + let g = client.music.getGuild(guild.id); + + if(g.dispatcher) { + g.dispatcher.end(reason); + }; + }; }