diff options
Diffstat (limited to 'figlet.py')
-rw-r--r--[l---------] | figlet.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/figlet.py b/figlet.py index 7d63417..8f88416 120000..100644 --- a/figlet.py +++ b/figlet.py @@ -1 +1,20 @@ -../figlet.py
\ No newline at end of file +#!/usr/bin/python +import re, os + +class Figlet(object): + def onRecv(self, IRC, line, data): + if data==None: return + (origin, ident, host, cmd, target, params, extinfo)=data + if len(target) and target[0]=="#" and cmd=="PRIVMSG": + channel=IRC.channel(target) + matches=re.findall("^!figlet\\s+(.*)$",extinfo) + if matches: + gif,fig=os.popen2("figlet") + gif.write(matches[0]) + gif.close() + while True: + line=fig.readline() + if line=="": break + if re.match("^\\s+$", line.rstrip()): continue + channel.msg(line.rstrip()) + fig.close() |