mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
commands.wrap update
This commit is contained in:
parent
dd1550afcc
commit
98c716d8cb
@ -56,15 +56,13 @@ import supybot
|
|||||||
__revision__ = '$Id$'
|
__revision__ = '$Id$'
|
||||||
__author__ = supybot.authors.baggins
|
__author__ = supybot.authors.baggins
|
||||||
|
|
||||||
import supybot.plugins as plugins
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import math
|
import math
|
||||||
import string
|
import string
|
||||||
|
|
||||||
import supybot.conf as conf
|
import supybot.conf as conf
|
||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
import supybot.privmsgs as privmsgs
|
from supybot.commands import *
|
||||||
import supybot.callbacks as callbacks
|
import supybot.callbacks as callbacks
|
||||||
|
|
||||||
|
|
||||||
@ -96,21 +94,17 @@ def configure(advanced):
|
|||||||
|
|
||||||
|
|
||||||
class Nickometer(callbacks.Privmsg):
|
class Nickometer(callbacks.Privmsg):
|
||||||
def __init__(self):
|
|
||||||
callbacks.Privmsg.__init__(self)
|
|
||||||
|
|
||||||
def punish(self, damage, reason):
|
def punish(self, damage, reason):
|
||||||
self.log.debug('%s lameness points awarded: %s' % (damage, reason))
|
self.log.debug('%s lameness points awarded: %s' % (damage, reason))
|
||||||
return damage
|
return damage
|
||||||
|
|
||||||
def nickometer(self, irc, msg, args):
|
def nickometer(self, irc, msg, args, nick):
|
||||||
"""[<nick>]
|
"""[<nick>]
|
||||||
|
|
||||||
Tells you how lame said nick is. If <nick> is not given, uses the
|
Tells you how lame said nick is. If <nick> is not given, uses the
|
||||||
nick of the person giving the command.
|
nick of the person giving the command.
|
||||||
"""
|
"""
|
||||||
score = 0L
|
score = 0L
|
||||||
nick = privmsgs.getArgs(args, required=0, optional=1)
|
|
||||||
if not nick:
|
if not nick:
|
||||||
nick = msg.nick
|
nick = msg.nick
|
||||||
originalNick = nick
|
originalNick = nick
|
||||||
@ -253,6 +247,7 @@ class Nickometer(callbacks.Privmsg):
|
|||||||
self.log.debug('Calculated lameness score for %s as %s '
|
self.log.debug('Calculated lameness score for %s as %s '
|
||||||
'(raw score was %s)' %
|
'(raw score was %s)' %
|
||||||
(originalNick, score_string, score))
|
(originalNick, score_string, score))
|
||||||
|
nickometer = wrap(nickometer, [additional('text')])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user