Skip to content
MCMrARM edited this page Aug 27, 2018 · 2 revisions

The client lets you define custom command aliases, using a simple syntax. To start, go to the client Settings, and open the Notification aliases section. You can add a new alias using the plus button in the bottom right.

Fields in the command alias editor:

  • Name - the name of the alias. This will be the name you'll be using after entering the / into the text box.
  • Syntax - the base syntax is as follows: <arg-name> defines a required argument, while [arg-name] defines an optional argument. If you would like the argument to take as much text as possible, you can suffix the name with ... (eg. [message...]) Additionally, depending on the name, the application may provide additional autocompletion context (* means anything):
    • channel or *-channel (or channel or *-channels) - IRC channels, doesn't include direct chats
    • user or *-user (or users or *-users) - a user nick, global
    • member or *-member (or members or *-members) - a channel member nick
    • target or *-target (or targets or *-targets) - a IRC channel or user nick (global)
  • Type - there are three types available, and the other fields depend on which mode is selected:
    • Message - send a message to the specified channel or user:
      • Channel - the channel or user to send the message to, can contain variables
      • Text - the message text, can contain variables
    • Client command - the command defined in Text will be processed by the client in the same way as if it was written by the user with a slash
      • Text - the command to run
    • Raw - sends a raw IRC message, useful to define new commands not included in the client
      • Text - the command to run

The variable system lets you use information known by the client about the message context or the arguments passed to the command. You can access simple variables by using the following syntax: ${var-name}. All arguments passed to the command will be available as variables (if the argument was optional and no value was given, the value will be an empty string). Additionally, the following variables are defined:

  • channel - the current channel in which the user is in, this can also be a nick if the user is in a private conversation
  • nick - the current nick of the user
  • args - a list of the arguments
  • ctcp_delim - the CTCP escape character (\001)

For list arguments (args and user arguments suffixed with ...), it is additionally possible to use python-style array accessors, eg. args[2] for the third element (indexes start from zero), args[1:2] for second and third element, args[1:] for all arguments except for the first one, args[:2] for the first three elements.

Examples

All the default commands in the client are defined using the above options. You can preview any default command in the client by tapping on it on the command aliases screen.

  • /me - Name: me, Syntax: [message...], Type: Message, Channel: ${channel} (check the default defined variables above), Text: ${ctcp_delim}ACTION ${message}${ctcp_delim}
  • A simple NickServ alias - Name: ns, Syntax: <message...>, Type: Message, Channel: NickServ, Text: ${message}
Clone this wiki locally