PhpFilter module¶
Description¶
This module transforms its input using a PHP stream filter.
Configuration¶
Options¶
This module provides several configuration options.
Name | Type | Default value | Description |
---|---|---|---|
trigger | string | “filter” | The command to use to ask the bot to transform a text using a filter. |
whitelist | string | “string.*,convert.*“ | A whitelist of allowed filters, separated by commas. Wildcards supported. |
Warning
The trigger should only contain alphanumeric characters (in particular, do not add any prefix, like ”!” to that value).
Example¶
In this example, we configure the bot to allow only a few string filters to be used (toupper which turns all letters into uppercase, tolower which turns them into lowercase letters and rot13 which applies a 13 letters rotation to text, much like Caesar’s cipher).
<?xml version="1.0"?>
<configuration
xmlns="http://localhost/Erebot/"
version="0.20"
language="fr-FR"
timezone="Europe/Paris">
<modules>
<!-- Other modules ignored for clarity. -->
<module name="\Erebot\Module\PhpFilter">
<param name="whitelist" value="string.toupper,string.tolower,string.rot13" />
</module>
</modules>
</configuration>
Usage¶
This section assumes default values are used for all triggers. Please refer to configuration options for more information on how to customize triggers.
Provided commands¶
This module provides the following commands:
Command | Description |
---|---|
!filter | Displays available filters and a quick usage note. |
!filter filter input | Displays the result of using the given filter on the given input. |