IRC Commands

From PurpleIRC Wiki
Jump to: navigation, search

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.

       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.

       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
       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!       <= Use IRC style host masks for additional security.


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