From 0d802dab5b586d511a6291248702c910502acaf7 Mon Sep 17 00:00:00 2001 From: Brian Sherson Date: Wed, 4 Dec 2013 01:35:44 -0800 Subject: Significant changes --- figlet.py | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'figlet.py') diff --git a/figlet.py b/figlet.py index 10120bb..d36a2ed 100644 --- a/figlet.py +++ b/figlet.py @@ -4,22 +4,17 @@ import os class Figlet(object): - def onRecv(self, IRC, line, data): - if data is 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() + def onChanMsg(self, IRC, user, channel, targetprefix, msg): + matches = re.findall("^!figlet\\s+(.*)$", msg) + 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() -- cgit v1.2.3