Commands

Tinkr.Util.Commands

function Commands:New(prefix)
function Commands:Register(command, handler, help, arguments)
local Tinkr = ...
local Commands = Tinkr.Util.Commands
 
local awesome = Commands:New('awesome')
 
-- Create the slash command /awesome test
awesome:Register('test', function(option)
print(option)
end, 'A simple test command', { 'option' })
 
-- Creates the slash commands /awesome foo AND /awesome bar
awesome:Register({ 'foo', 'bar' }, function(baz, bang)
print(baz, bang)
end, 'Another test command', { 'baz', 'bang' })