Custom Commands(3)
- LynxBot manual
DESCRIPTION
Custom Commands are user-defined commands which respond with a message when used.
Like all default bot commands, custom commands begin with a dollar sign $, followed by a keyword.
The keyword for each custom command must be unique; it cannot be identical to any default command or other custom command.
Each custom command can also have a cooldown during which no regular users can use them. Chat subscribers and moderators are exempt from cooldowns. The default cooldown for custom commands is 15 seconds.
The reponse of a custom command can accept several different format sequences - placeholders in which data is inserted. These are as follows:
- %b - the Twitch username of the bot
- %c - the name of the Twitch channel
- %n - Twitch username of the person that activated the command
- %N - equivalent to "@%n," i.e. "@NICK,"
- %u - number of times that the command has been used
- %% - a literal '%'
Here is an example of a command response that uses all these format sequences:
Hi, %n, this is %b, the resident bot of %c. This command has been used %u times. %N keep it 100%%.
If this command is used by someone named randalicious in the channel #lynxbot with a bot named bot_test_, the response will be:
Hi, randalicious, this is bot_test_, the resident bot of lynxbot. This command has been used 5 times. @randalicious, keep it 100%.
USAGE
Custom commands can be added, modified and deleted through the addcom, editcom and delcom commands, respectively.
Alternatively, they can be modified directly in the file json/customcmds.json, in which they are stored.