Skip to content
Kalbintion Kier edited this page Feb 11, 2019 · 40 revisions

commands is a core command found with Kdkbot. This command is the basis for adding additional custom string commands from channel to channel.

Syntax

commands <new <trigger> <rank> <message> | edit <trigger> <method <new value>> | remove <trigger> | list [rank] | view <trigger> <method>>

Since the above can be a bit annoying to decipher, the syntax for each sub-command is as follows:

  • commands new <trigger> <rank> <message>
  • commands edit <trigger> <method> <new value>
  • commands view <trigger> <method>
  • commands remove <trigger>
  • commands list [c | custom] [rank]

New

commands new is a way to add additional commands to a particular channel. This command expects a trigger word, a rank, and the message. A trigger word is the command text that will cause the message to show, assuming a user is of at least the provided rank.

The message can consist of various percent-args that will expand into variable amounts of content. See Percent-Args for more details.

View

commands view is a way to see a commands values without having to have the preknowledge of what they are. It expects the commands trigger word to know which command to look at. From there, it expects one of the keywords: level, message, or available to indication which option to send information for.

Edit

commands edit is a way to edit existing commands for a particular channel. It expects the commands trigger word to know which command to edit. From there, it expects one of the keywords: level, message, available, or trigger to indicate which option to change and an appropriate value after it.

  • rank expects a numerical value, that can be anywhere from -2 billion to 2 billion.
  • message expects a string associated with it. See the new section for more information.
  • available expects a boolean value that indicates whether this command is available (true) or not available (false)
  • trigger expects a new command trigger word

Remove

commands remove is a way to remove custom commands from a particular channel. It expects the commands trigger word to know which command to remove. Please note that this command will not work on removing core commands, or commands you do not have the rank to remove.'

Warning: While the user may not have permission to remove a command, they may edit the command to reduce the required rank to something that then permits them to remove the command. This is intended behavior and will not be modified. Be wary of what information is presented in higher-ranked commands and what their actions may hold for users who exploit this mechanic

List

commands list is a way to display available commands for a particular channel. This list is valid only for the person who used the command unless a rank is provided to list the available commands for. To specify only custom commands to be shown, which removes the core and default commands from the list, use commands list custom or commands list c.

A rank may be specified afterwards to only show commands at a particular rank. (ie: commands list 3 or commands list c 3) A rank of "*" can be supplied to show all commands in a particular channel. Be aware that this can cause a massive amount of chat spam depending on the number of commands!

Percent-Args

Percent-Args is a method in which to include non-static information within custom commands. Their syntax is styled around the Windows Batch Variable system and those familiar with that system should feel at home with these.

For more information, see the main article: Percent-Args

Examples

These are some examples of how the commands command works under various scenarios. Note that these commands could be sequentially sent to a channel to see each one take effect before the final line removing the example helloworld commmand used in the examples.

  • commands new helloworld 0 Hello Everyone!
  • commands edit helloworld message Hello Everybody!
  • commands edit helloworld rank 2
  • commands view helloworld message
  • commands view helloworld rank
  • commands remove helloworld

Clone this wiki locally