summaryrefslogtreecommitdiff
path: root/plugins/double.py
blob: 02c7ddcd894de7dfa66615c9d155ff06a2590036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
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']