From fe5a9ccdc2f3086c9995e1a0c493afb515e2064a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hor=C3=A1=C4=8Dek?= Date: Sun, 12 Apr 2020 11:21:38 +0200 Subject: [PATCH 1/4] add joinArguments conf --- commands/play.js | 3 ++- events/message.js | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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..1c6da3c 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[argsLength - 1] = args.slice(argsLength - 1).join(' '); + } + }; + client.logger.log(`Command ran: ${cmd.help.name}`) - cmd.run(client, message, args, level, data) + cmd.run(client, message, argsPossiblyJoined, level, data) } From 8e850b1adf8b444d7ba84e87cbfa9907b81be72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hor=C3=A1=C4=8Dek?= Date: Sun, 12 Apr 2020 11:22:28 +0200 Subject: [PATCH 2/4] fix joinArguments conf --- events/message.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/message.js b/events/message.js index 1c6da3c..13a46c2 100644 --- a/events/message.js +++ b/events/message.js @@ -111,7 +111,7 @@ module.exports = async (client, message) => { if(cmd.conf.joinArguments) { if(args.length > cmd.conf.joinArguments && args.length > 1) { - argsPossiblyJoined[argsLength - 1] = args.slice(argsLength - 1).join(' '); + argsPossiblyJoined[cmd.conf.joinArguments - 1] = args.slice(cmd.conf.joinArguments - 1).join(' '); } }; From 0de96409a0a130a880baf2f23fc7c9b2d3488984 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 12 Apr 2020 19:24:14 +1000 Subject: [PATCH 3/4] i fucking hate family time --- commands/emoji.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' } From 818a923a37f0e08344aa2025d56b72b643eec2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hor=C3=A1=C4=8Dek?= Date: Sun, 12 Apr 2020 11:24:58 +0200 Subject: [PATCH 4/4] forceskip --- commands/forceskip.js | 22 ++++++++++++++++++++++ helpers/music.js | 8 ++++++++ 2 files changed, 30 insertions(+) create mode 100644 commands/forceskip.js 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); + }; + }; }