diff --git a/bot.lua b/bot.lua index d2b2c50..3c59153 100644 --- a/bot.lua +++ b/bot.lua @@ -21,9 +21,10 @@ end) client:on('messageCreate', function(message) if message.author.bot then return end local args = message.content:split(" ") - local command = commands[args[1]] + local lowerArgs = args[1]:lower() + local command = commands[lowerArgs] if command then - command.exec(message) + command.exec(message, args) end end) diff --git a/simpleCommands.lua b/simpleCommands.lua index 3d47c0f..6c988a6 100644 --- a/simpleCommands.lua +++ b/simpleCommands.lua @@ -40,6 +40,11 @@ local commands = { -- Define commands its a table that will contain our commands message:delete() end }; +[prefix..'testArgs'] = { -- + exec = function (message, args) + message.channel:send(args[2]) + end + }; }