poezio/plugins/double.py

15 lines
388 B
Python
Raw Normal View History

"""
Double the first word of any message you send in a :ref:`muctab`, making you appear retarded.
"""
from poezio.plugin import BasePlugin
2018-08-15 11:13:17 +00:00
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']