mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-21 16:10:39 +01:00
Karma: Display the new karma when it is updated.
This commit is contained in:
parent
cb827c09df
commit
3137db859f
@ -232,9 +232,10 @@ class Karma(callbacks.Plugin):
|
|||||||
thing = thing[1:-1]
|
thing = thing[1:-1]
|
||||||
return thing
|
return thing
|
||||||
|
|
||||||
def _respond(self, irc, channel):
|
def _respond(self, irc, channel, thing, karma):
|
||||||
if self.registryValue('response', channel):
|
if self.registryValue('response', channel):
|
||||||
irc.replySuccess()
|
irc.reply(_('%(thing)s\'s karma is now %(karma)i') %
|
||||||
|
{'thing': thing, 'karma': karma})
|
||||||
else:
|
else:
|
||||||
irc.noReply()
|
irc.noReply()
|
||||||
|
|
||||||
@ -247,7 +248,8 @@ class Karma(callbacks.Plugin):
|
|||||||
irc.error(_('You\'re not allowed to adjust your own karma.'))
|
irc.error(_('You\'re not allowed to adjust your own karma.'))
|
||||||
elif thing:
|
elif thing:
|
||||||
self.db.increment(channel, self._normalizeThing(thing))
|
self.db.increment(channel, self._normalizeThing(thing))
|
||||||
self._respond(irc, channel)
|
karma = self.db.get(channel, self._normalizeThing(thing))
|
||||||
|
self._respond(irc, channel, thing, karma[0]-karma[1])
|
||||||
else:
|
else:
|
||||||
thing = thing[:-2]
|
thing = thing[:-2]
|
||||||
if ircutils.strEqual(thing, irc.msg.nick) and \
|
if ircutils.strEqual(thing, irc.msg.nick) and \
|
||||||
@ -255,7 +257,8 @@ class Karma(callbacks.Plugin):
|
|||||||
irc.error(_('You\'re not allowed to adjust your own karma.'))
|
irc.error(_('You\'re not allowed to adjust your own karma.'))
|
||||||
elif thing:
|
elif thing:
|
||||||
self.db.decrement(channel, self._normalizeThing(thing))
|
self.db.decrement(channel, self._normalizeThing(thing))
|
||||||
self._respond(irc, channel)
|
karma = self.db.get(channel, self._normalizeThing(thing))
|
||||||
|
self._respond(irc, channel, thing, karma[0]-karma[1])
|
||||||
|
|
||||||
def invalidCommand(self, irc, msg, tokens):
|
def invalidCommand(self, irc, msg, tokens):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user