poezio/plugins/double.py
mathieui d676c2ee7b Move the plugins documentation
(use automodule directive & docstrings)
2013-04-13 22:33:06 +02:00

22 lines
482 B
Python

"""
Double the first word of any message you send in a :ref:`muctab`, making you appear retarded.
Installation
------------
You only have to load the plugin:
.. code-block:: none
/load double
"""
from plugin import BasePlugin
class Plugin(BasePlugin):
def init(self):
self.api.add_event_handler('muc_say', self.double)
def double(self, msg, tab):
split = msg['body'].split()
if split:
msg['body'] = split[0] + ' ' + msg['body']