User Tools

Site Tools


melanobot:configuration:handlers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
melanobot:configuration:handlers [2015/05/12 10:02]
melanosuchus
melanobot:configuration:handlers [2015/05/26 15:35] (current)
Line 21: Line 21:
   * **direct** ''​false''​ -- Whether the handler is triggered only from messages explicitly directed to the bot or can be triggered by any message. (Examples of direct messages on IRC are private messages or channel messages beginning with the IRC bot name)   * **direct** ''​false''​ -- Whether the handler is triggered only from messages explicitly directed to the bot or can be triggered by any message. (Examples of direct messages on IRC are private messages or channel messages beginning with the IRC bot name)
  
-===== Templates ===== 
-The template system allows to create complex handler with custom parameters. 
- 
-==== Template Definition ==== 
-Templates are defined in the **templates** top-level group. 
-Their name is determined by the key used here.  
- 
-They are required to have the **type** key, which specifies which handler type this template is going to become. (Most likely [[melanobot:​modules:​core#​Group]] is the most useful). 
- 
-Then it can contain anything allowed in a definition of the corresponding handler type. 
- 
-In addition to the normal handler keys, template definitions allow to declare parameters, which will be replaced when the template is instantiated. 
-Parameters are defined as simple keys whose name starts with **@** their value (if any) will be used as default when not expressed by the instantiation. 
- 
-All values containing those parameters (including the **@**) will be replaced to the correct values. 
- 
-==== Template Instantiation ==== 
-A template instantiation uses the same form as a handler instantiation with "​**Template**"​ as type. 
- 
-The require the key ''​**template**''​ to be the name of the template to instantiate. 
- 
-Then any parameter defined in the template can be assigned a value. 
-Here parameters don't use the leading **@**. 
- 
- 
-===== Connection ===== 
-To make some things easier, connections can be defined wherever a handler can. Of course Connections are not affected by groups or other handler-specific settings. 
melanobot/configuration/handlers.txt · Last modified: 2015/05/26 15:35 (external edit)