-
Notifications
You must be signed in to change notification settings - Fork 0
Usercommands
You may be interested in the usercommands management.
It's really simple to add your own commands, just follow this guide.
Note: the usercommands are still unfinished, things may change and things may be added. So please check this wiki page from time to time.
Open up the commands.xml file. In there is already one command (the !quit command). As you see you have two lines per command, every command is covered by <item> tags.
To add your own command add a new <item> tag underneath the first item, you may also delete the !quit command.
Now inside of your <item> block add the tags for the <command> and the <trigger>. You may also add the tag <perm> to use the simple permission system introduced in 0d94682449. To make the command only executable for a specific user you may add a nickname between the perm tags. It should now look like this:
Inside of the <command> tag add the command for which the bot should listen. So adding "hello" here makes the bot listen to "!hello".
Inside of the <trigger> tag you may add the things the bot should do for you. For example "PRIVMSG #testchan :hello everyone" will make the bot say "hello everyone" in the channel #testchan.
Your commands.xml may now look like this:
There are some special variables you may use in the trigger. Here is a list of them:
- {$sender} - The nickname of the command issuer
- {$args} - All arguments given to the command devided by spaces
- {$arg(number)} ({$arg1}) - The numberth argument given to the command
- {$channel} - The channel or the user the command came from
- {$time} - The time when the command was issued
- {$cmd} - The command itself - was added for debugging purposes
- {$soh} - The "Start of heading" char - needed for /me actions (wiki page coming)