mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-04 08:59:23 +01:00
Added RFE #890130.
This commit is contained in:
parent
b51961b18a
commit
a32a263b90
@ -165,12 +165,24 @@ class Karma(callbacks.PrivmsgCommandAndRegexp, plugins.ChannelDBHandler):
|
|||||||
ORDER BY added-subtracted ASC
|
ORDER BY added-subtracted ASC
|
||||||
LIMIT %s""", limit)
|
LIMIT %s""", limit)
|
||||||
lowest=['%r (%s)' % (t[0], int(t[1])) for t in cursor.fetchall()]
|
lowest=['%r (%s)' % (t[0], int(t[1])) for t in cursor.fetchall()]
|
||||||
|
cursor.execute("""SELECT added-subtracted FROM karma
|
||||||
|
WHERE name=%s""", msg.nick)
|
||||||
if not (highest and lowest):
|
if not (highest and lowest):
|
||||||
irc.error('I have no karma for this channel.')
|
irc.error('I have no karma for this channel.')
|
||||||
else:
|
return
|
||||||
s = 'Highest karma: %s. Lowest karma: %s.' % \
|
rankS = ''
|
||||||
(utils.commaAndify(highest), utils.commaAndify(lowest))
|
if cursor.rowcount != 0:
|
||||||
irc.reply(s)
|
personal = int(cursor.fetchone()[0])
|
||||||
|
cursor.execute("""SELECT COUNT(*) FROM karma
|
||||||
|
WHERE added-subtracted > %s""", personal)
|
||||||
|
rank = int(cursor.fetchone()[0]) + 1
|
||||||
|
cursor.execute("""SELECT COUNT(*) FROM karma""")
|
||||||
|
total = int(cursor.fetchone()[0])
|
||||||
|
rankS = ' You (%s) are ranked %s out of %s.' % \
|
||||||
|
(msg.nick, rank, total)
|
||||||
|
s = 'Highest karma: %s. Lowest karma: %s.%s' % \
|
||||||
|
(utils.commaAndify(highest), utils.commaAndify(lowest), rankS)
|
||||||
|
irc.reply(s)
|
||||||
|
|
||||||
_mostAbbrev = utils.abbrev(['increased', 'decreased', 'active'])
|
_mostAbbrev = utils.abbrev(['increased', 'decreased', 'active'])
|
||||||
def most(self, irc, msg, args):
|
def most(self, irc, msg, args):
|
||||||
|
Loading…
Reference in New Issue
Block a user