IRC Commands: Difference between revisions

From PurpleIRC Wiki
(Created page with "There are a number of built-in commands available to the IRC bot. In addition, an almost unlimited number of custom commands are possible. == Command Prefix == The default...")
 
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
There are a number of built-in commands available to the IRC bot. In addition, an almost unlimited number of custom commands are possible.  
There are a number of built-in commands available to the IRC bot. In addition, an almost unlimited number of custom commands are possible. Commands are all configured in the <code>commands</code> section of the bot yml file.


== Command Prefix ==
== Command Prefix ==
Line 8: Line 8:


== Built-in Commands ==
== Built-in Commands ==
Built-in commands are denoted by an <code>@</code>. This is not to be confused the command prefix. Example command.
    commands:
      list:
        [[IRC_Modes|modes]]: '*'            <font color="#0000FF"><= User must have matching IRC mode to run this command. The * indicates any mode.</font>
        private: false        <font color="#0000FF"><= The bot will respond to commands in private if this is true.</font>
        ctcp: false            <font color="#0000FF"><= The bot will respond with a CTCP message if this is true.</font>
        game_command: '@list'  <font color="#0000FF"><= The command that should be executed. In this example @list is PurpleIRC built-in command for listing online players.</font>
        private_listen: true  <font color="#0000FF"><= If this is true then the bot will respond to commands sent via private message.</font>
        channel_listen: true  <font color="#0000FF"><= If this is true then the bot will respond to commands sent publicly in its channel.</font>
        sender: 'CONSOLE'      <font color="#0000FF"><= The name of the sender that executes the command. Replace with <code>%NICK%</code> to use the IRC user's nickname instead of CONSOLE.</font>
== Custom Commands ==
Custom commands are passed to the game via the console.
    commands:
      lag:
        [[IRC_Modes|modes]]: '*'
        private: false
        ctcp: false
        game_command: lag            <font color="#0000FF"><= Non built-in commands are written exactly as they are typed in the console.</font>
        private_listen: true
        channel_listen: true
      gamemode:
        [[IRC_Modes|modes]]: 'o'                    <font color="#0000FF"><= Example command that requires IRC user to have channel ops.</font>
        private: false
        ctcp: false
        game_command: gamemode %ARGS% <font color="#0000FF"><= Example command that accepts arguments.</font>
        private_listen: true
        channel_listen: true
        user_masks:
        - user!user@example.com      <font color="#0000FF"><= Use IRC style host masks for additional security.</font>
== Samples ==
See the sample bot files that are created on start up for more example commands. The file will also list all built-in commands.

Latest revision as of 16:29, 27 September 2015

There are a number of built-in commands available to the IRC bot. In addition, an almost unlimited number of custom commands are possible. Commands are all configured in the commands section of the bot yml file.

Command Prefix

The default command prefix is configured per bot. The option command-prefix sets the prefix. The default value is a dot.

command-prefix: '.'

Built-in Commands

Built-in commands are denoted by an @. This is not to be confused the command prefix. Example command.

   commands:
     list:
       modes: '*'             <= User must have matching IRC mode to run this command. The * indicates any mode.
       private: false         <= The bot will respond to commands in private if this is true.
       ctcp: false            <= The bot will respond with a CTCP message if this is true.
       game_command: '@list'  <= The command that should be executed. In this example @list is PurpleIRC built-in command for listing online players.
       private_listen: true   <= If this is true then the bot will respond to commands sent via private message.
       channel_listen: true   <= If this is true then the bot will respond to commands sent publicly in its channel.
       sender: 'CONSOLE'      <= The name of the sender that executes the command. Replace with %NICK% to use the IRC user's nickname instead of CONSOLE.

Custom Commands

Custom commands are passed to the game via the console.

   commands:
     lag:
       modes: '*'
       private: false
       ctcp: false
       game_command: lag             <= Non built-in commands are written exactly as they are typed in the console.
       private_listen: true
       channel_listen: true
     gamemode:
       modes: 'o'                    <= Example command that requires IRC user to have channel ops. 
       private: false
       ctcp: false
       game_command: gamemode %ARGS% <= Example command that accepts arguments.
       private_listen: true
       channel_listen: true
       user_masks:
       - user!user@example.com       <= Use IRC style host masks for additional security.

Samples

See the sample bot files that are created on start up for more example commands. The file will also list all built-in commands.