User Tools

Site Tools


melanobot:configuration

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 [2015/05/15 17:21]
melanosuchus
melanobot:configuration [2015/05/26 15:35] (current)
Line 66: Line 66:
   * **[[Melanobot:​Modules:​Web|web]]** -- HTTP request messages   * **[[Melanobot:​Modules:​Web|web]]** -- HTTP request messages
   * **[[Melanobot:​Modules:​Core|sys]]** -- System messages   * **[[Melanobot:​Modules:​Core|sys]]** -- System messages
 +
 +===== 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 **@**.
 +
 +
melanobot/configuration.txt · Last modified: 2015/05/26 15:35 (external edit)