mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-03 16:39:25 +01:00
Ooh, a better implementation. I rock.
This commit is contained in:
parent
1cb8cd0933
commit
6504dfcaa1
@ -185,6 +185,10 @@ class WordStats(callbacks.Privmsg):
|
|||||||
self.db.close()
|
self.db.close()
|
||||||
callbacks.Privmsg.die(self)
|
callbacks.Privmsg.die(self)
|
||||||
|
|
||||||
|
def callCommand(self, *args, **kwargs):
|
||||||
|
self.queried = True
|
||||||
|
return callbacks.Privmsg.callCommand(self, *args, **kwargs)
|
||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
# This depends on the fact that it's called after the command.
|
# This depends on the fact that it's called after the command.
|
||||||
try:
|
try:
|
||||||
@ -211,7 +215,6 @@ class WordStats(callbacks.Privmsg):
|
|||||||
irc.error('<word> must not contain non-alphanumeric chars.')
|
irc.error('<word> must not contain non-alphanumeric chars.')
|
||||||
return
|
return
|
||||||
self.db.addWord(channel, word)
|
self.db.addWord(channel, word)
|
||||||
self.queried = True
|
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
|
|
||||||
def remove(self, irc, msg, args):
|
def remove(self, irc, msg, args):
|
||||||
@ -276,7 +279,6 @@ class WordStats(callbacks.Privmsg):
|
|||||||
if count:
|
if count:
|
||||||
s = '%s has said %r %s.' % \
|
s = '%s has said %r %s.' % \
|
||||||
(user, word, utils.nItems('time', count))
|
(user, word, utils.nItems('time', count))
|
||||||
self.queried = True
|
|
||||||
irc.reply(s)
|
irc.reply(s)
|
||||||
else:
|
else:
|
||||||
irc.error('%s has never said %r.' % (user, word))
|
irc.error('%s has never said %r.' % (user, word))
|
||||||
@ -286,7 +288,6 @@ class WordStats(callbacks.Privmsg):
|
|||||||
if total == 0:
|
if total == 0:
|
||||||
irc.reply('I\'m keeping stats on %s, but I haven\'t seen it '
|
irc.reply('I\'m keeping stats on %s, but I haven\'t seen it '
|
||||||
'in this channel.' % word)
|
'in this channel.' % word)
|
||||||
self.queried = True
|
|
||||||
return
|
return
|
||||||
n = self.registryValue('rankingDisplay', channel)
|
n = self.registryValue('rankingDisplay', channel)
|
||||||
try:
|
try:
|
||||||
@ -318,7 +319,6 @@ class WordStats(callbacks.Privmsg):
|
|||||||
else:
|
else:
|
||||||
s = ''
|
s = ''
|
||||||
ret = '%s %s.%s' % (ret, utils.commaAndify(L), s)
|
ret = '%s %s.%s' % (ret, utils.commaAndify(L), s)
|
||||||
self.queried = True
|
|
||||||
irc.reply(ret)
|
irc.reply(ret)
|
||||||
else:
|
else:
|
||||||
user = arg1
|
user = arg1
|
||||||
|
Loading…
Reference in New Issue
Block a user