summaryrefslogtreecommitdiff
path: root/figlet.py
diff options
context:
space:
mode:
authorBrian Sherson <caretaker82@euclid.shersonb.net>2013-12-04 01:35:44 -0800
committerBrian Sherson <caretaker82@euclid.shersonb.net>2013-12-04 01:35:44 -0800
commit0d802dab5b586d511a6291248702c910502acaf7 (patch)
treef370db15b1a29c2fa8b6699188d28923b1361462 /figlet.py
parent5cf8d2185f89aaf30e856bd0dbca88fbb51789ba (diff)
Significant changes
Diffstat (limited to 'figlet.py')
-rw-r--r--figlet.py33
1 files changed, 14 insertions, 19 deletions
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()