Super-useful figlet plugin
This commit is contained in:
parent
961cf5df85
commit
b7027e5347
1 changed files with 11 additions and 0 deletions
11
plugins/figlet.py
Normal file
11
plugins/figlet.py
Normal file
|
@ -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
|
Loading…
Reference in a new issue