summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-06 23:46:35 +0100
committermathieui <mathieui@mathieui.net>2011-11-06 23:46:35 +0100
commitb7027e53474c208d7b772794fd34b30092bc4df1 (patch)
tree4a50424cf4b96eca2fb4bd45c532e0b1e57fae0d /plugins
parent961cf5df8548ec0985f2755d21af933d8c023ee4 (diff)
downloadpoezio-b7027e53474c208d7b772794fd34b30092bc4df1.tar.gz
poezio-b7027e53474c208d7b772794fd34b30092bc4df1.tar.bz2
poezio-b7027e53474c208d7b772794fd34b30092bc4df1.tar.xz
poezio-b7027e53474c208d7b772794fd34b30092bc4df1.zip
Super-useful figlet plugin
Diffstat (limited to 'plugins')
-rw-r--r--plugins/figlet.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/figlet.py b/plugins/figlet.py
new file mode 100644
index 00000000..ccff687a
--- /dev/null
+++ b/plugins/figlet.py
@@ -0,0 +1,11 @@
+from plugin import BasePlugin
+import subprocess
+
+class Plugin(BasePlugin):
+ def init(self):
+ self.add_poezio_event_handler('muc_say', self.figletize)
+
+ def figletize(self, msg):
+ process = subprocess.Popen(['figlet', msg['body']], stdout=subprocess.PIPE)
+ result = process.communicate()[0].decode('utf-8')
+ msg['body'] = result