setCommandEvent


General

setCommandEvent is a method defining a function, which will be called after a command is executed at your Discord guild.


Usage

Client:setCommandEvent(<number> interval, (string) commandName, <function> callback, (number) channelId)
Returns: <Connection> commandConnection

The callback function should use these arguments:
<array> arguments, <Message> message, <number> timestamp

The function is called by the gameCommand.

It is a singleton function. It won't run on all the server - just a single one to avoid function event fired multiple times.


Limitations

See getActionEvent.


Example

function handleTestCommand(args, cmd)
	return Client:editMessage(cmd.confirmation.channel.id, cmd.confirmation.id, "Successfully fetched the message!");
end

Client:setCommandEvent(5, "Test", handleTestCommand) 

Back to top