summaryrefslogtreecommitdiff
path: root/cannon.py
diff options
context:
space:
mode:
authorBrian Sherson <caretaker82@euclid.shersonb.net>2014-03-22 20:52:05 -0700
committerBrian Sherson <caretaker82@euclid.shersonb.net>2014-03-22 20:52:05 -0700
commit5c66d93f0ca04c06f3ed122772b9751b3dcc3f6e (patch)
tree0ec0aa59f5afb7588fe35c95d3d3495ec5b0d503 /cannon.py
parent0b695d73168af6a8444e1c0a0f4e6b0f85506fc4 (diff)
Adding CAP support, ircapp.py with sample config, speeding up channel and user cache lookup.
Diffstat (limited to 'cannon.py')
-rw-r--r--cannon.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cannon.py b/cannon.py
index c9acea0..0911245 100644
--- a/cannon.py
+++ b/cannon.py
@@ -9,12 +9,12 @@ class Cannon(object):
def __init__(self):
self.firecount = {}
- def onChanMsg(self, IRC, user, channel, targetprefix, msg):
+ def onChanMsg(self, context, user, channel, targetprefix, msg):
matches = re.findall("^!fire\\s+(.*)$", msg)
if matches:
nickname = matches[0]
if any([nickname.lower() == usr.nick.lower() for usr in channel.users]):
- vic = IRC.user(nickname)
+ vic = context.user(nickname)
if vic in self.firecount.keys():
count = self.firecount[vic] + 1
else:
@@ -37,5 +37,5 @@ class Cannon(object):
"%s: I cannot fire %s out of a cannon, as he or she is not here." %
(user.nick, nickname))
- def onSendChanMsg(self, IRC, origin, channel, targetprefix, msg):
- self.onChanMsg(IRC, IRC.identity, channel, targetprefix, msg)
+ def onSendChanMsg(self, context, origin, channel, targetprefix, msg):
+ self.onChanMsg(context, context.identity, channel, targetprefix, msg)