diff --git a/commands/emoji.js b/commands/emoji.js index 1bdf275..cfe7f32 100644 --- a/commands/emoji.js +++ b/commands/emoji.js @@ -9,7 +9,7 @@ exports.conf = { exports.help = { name: 'emoji', category: 'Utility', - description: 'Enlarges a custom emoji.', + description: 'Enlarges a custom emoji (cannot be used to enlarge normal emojis)', usage: 'emoji [emoji]', parameters: '`[emoji] - Custom emoji you want to enlarge' } 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/commands/play.js b/commands/play.js index b96db38..e2b33d9 100644 --- a/commands/play.js +++ b/commands/play.js @@ -4,7 +4,8 @@ exports.conf = { aliases: [], permLevel: 'User', requiredPerms: [], - cooldown: 2000 + cooldown: 2000, + joinArguments: 1 } exports.help = { diff --git a/events/message.js b/events/message.js index 2375cb1..13a46c2 100644 --- a/events/message.js +++ b/events/message.js @@ -106,6 +106,15 @@ module.exports = async (client, message) => { message.flags.push(args.shift().slice(1)) } + let argsPossiblyJoined = args; + + if(cmd.conf.joinArguments) { + if(args.length > cmd.conf.joinArguments && args.length > 1) + { + argsPossiblyJoined[cmd.conf.joinArguments - 1] = args.slice(cmd.conf.joinArguments - 1).join(' '); + } + }; + client.logger.log(`Command ran: ${cmd.help.name}`) - cmd.run(client, message, args, level, data) + cmd.run(client, message, argsPossiblyJoined, level, data) } 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); + }; + }; }