diff options
author | mathieui <mathieui@mathieui.net> | 2012-12-18 01:54:20 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-12-18 01:54:20 +0100 |
commit | be8ea85a9f732f5c02a53033c0ad01d6ae9eed90 (patch) | |
tree | 6a0314b471cb04d29dc0865e40ad73f2bf645deb /plugins | |
parent | f291d07567236fcf06396399461822697e715b4e (diff) | |
download | poezio-be8ea85a9f732f5c02a53033c0ad01d6ae9eed90.tar.gz poezio-be8ea85a9f732f5c02a53033c0ad01d6ae9eed90.tar.bz2 poezio-be8ea85a9f732f5c02a53033c0ad01d6ae9eed90.tar.xz poezio-be8ea85a9f732f5c02a53033c0ad01d6ae9eed90.zip |
super-useful plugin that duplicates the first word of a message
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/double.py | 10 |
1 files changed, 10 insertions, 0 deletions
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'] |