diff options
author | mathieui <mathieui@mathieui.net> | 2013-04-08 18:52:35 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2013-04-08 18:52:35 +0200 |
commit | bd8d38d711e15d42ac8e797723af5242e4c3f4fb (patch) | |
tree | d3ea6da641be1c7e67a3123071cb816933436502 /doc/en/plugins/replace.txt | |
parent | e5f219d43edbb4b05c8890f81f2f93b90e215a10 (diff) | |
download | poezio-bd8d38d711e15d42ac8e797723af5242e4c3f4fb.tar.gz poezio-bd8d38d711e15d42ac8e797723af5242e4c3f4fb.tar.bz2 poezio-bd8d38d711e15d42ac8e797723af5242e4c3f4fb.tar.xz poezio-bd8d38d711e15d42ac8e797723af5242e4c3f4fb.zip |
Beginning of the migration to reST documentation
Diffstat (limited to 'doc/en/plugins/replace.txt')
-rw-r--r-- | doc/en/plugins/replace.txt | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/doc/en/plugins/replace.txt b/doc/en/plugins/replace.txt deleted file mode 100644 index 3a17ff20..00000000 --- a/doc/en/plugins/replace.txt +++ /dev/null @@ -1,71 +0,0 @@ -Replace -======= - -Replace some patterns in a message before sending it. - - -Installation ------------- -You only have to load the plugin. - -============== - - /load replace - -============== - -Usage ------ -Insert a pattern in the form - -========= - -%pattern% - -========= - -in your message, and it will be replaced by the corresponding text. - -The list of provided patterns is: - -- _time_: Insert the current time -- _date_: Insert the current date -- _datetime_: Insert the current date and time -- _random_nick_: Insert a random nick from the current MUC -- _dice_: Insert a random number between 1 and 6 - - -Add your own pattern --------------------- - -You can easily edit this plugin to add your own patterns. For example if -don’t want to search for an insult everytime you’re angry, you can create a -curse pattern this way: - -- In the init(self) method of the Plugin class, add something like - -================ -[source,python] - self.patterns['curse'] = replace_curse -================ - -- then define a function (not a method of the Plugin class) at the bottom -of the file. For example: - - -========================================================== -[source,python] -def replace_curse(message, tab): - return random.choice(['dumb shit', 'idiot', 'moron']) -========================================================== - -and you can now use something like - -==================== -Shut up, %curse%! -==================== - -in your everyday-conversations. - -For more conveniance, you can read your nice words from a file, do whatever -you want in that function, as long as it returns a string. |