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) }