Made commands case-insensitive, but maintained case in arguments and content. Removed test function

pull/1/head
Astoria Floyd 3 years ago
parent 4b3c016d34
commit 28cb7cf447

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

@ -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
};
}

Loading…
Cancel
Save