1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00
profanity/plugins/ascii.py
2013-08-31 15:16:05 +01:00

13 lines
438 B
Python

import prof
import subprocess
def prof_init(version, status):
prof.register_command("/ascii", 1, 1, "/ascii", "ASCIIfy a message", "ASCIIfy a message.", cmd_ascii)
def cmd_ascii(text):
recipient = prof.get_current_recipient()
if recipient:
proc = subprocess.Popen(['figlet', '--', text], stdout=subprocess.PIPE)
ascii_out = proc.communicate()[0].decode('utf-8')
prof.send_line(u'\u000A' + ascii_out)