From be8ea85a9f732f5c02a53033c0ad01d6ae9eed90 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 18 Dec 2012 01:54:20 +0100 Subject: super-useful plugin that duplicates the first word of a message --- plugins/double.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 plugins/double.py diff --git a/plugins/double.py b/plugins/double.py new file mode 100644 index 00000000..04728bbf --- /dev/null +++ b/plugins/double.py @@ -0,0 +1,10 @@ +from plugin import BasePlugin + +class Plugin(BasePlugin): + def init(self): + self.add_event_handler('muc_say', self.double) + + def double(self, msg, tab): + split = msg['body'].split() + if split: + msg['body'] = split[0] + ' ' + msg['body'] -- cgit v1.2.3