summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-12-18 02:03:24 +0100
committerFlorent Le Coz <louiz@louiz.org>2012-12-18 02:03:24 +0100
commitca7489fd8f17dbd437709bc81e3bad8ffef94345 (patch)
treeb9e325f8de1020be9c8caab1233262982dbda559 /plugins
parentbe8ea85a9f732f5c02a53033c0ad01d6ae9eed90 (diff)
downloadpoezio-ca7489fd8f17dbd437709bc81e3bad8ffef94345.tar.gz
poezio-ca7489fd8f17dbd437709bc81e3bad8ffef94345.tar.bz2
poezio-ca7489fd8f17dbd437709bc81e3bad8ffef94345.tar.xz
poezio-ca7489fd8f17dbd437709bc81e3bad8ffef94345.zip
super useful plugin that shuffles the message you send.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/shuffle.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/shuffle.py b/plugins/shuffle.py
new file mode 100644
index 00000000..beba0769
--- /dev/null
+++ b/plugins/shuffle.py
@@ -0,0 +1,11 @@
+from plugin import BasePlugin
+from random import shuffle
+
+class Plugin(BasePlugin):
+ def init(self):
+ self.add_event_handler('muc_say', self.shuffle)
+
+ def shuffle(self, msg, tab):
+ split = msg['body'].split()
+ shuffle(split)
+ msg['body'] = ' '.join(split)