Skip to content
Snippets Groups Projects
Commit 7e39defb authored by Bruce Cowan's avatar Bruce Cowan
Browse files

Fix replying on increment / decrement

parent 78b19786
No related branches found
No related tags found
No related merge requests found
.pytest_cache/
__pycache__/
......@@ -34,20 +34,19 @@ class Karma(BotPlugin):
def _change_karma(self, target, value, message):
self.karma[target] += value
text = "Karma for '{}' is now {}".format(target, self.karma[target])
self.send(message.to, text, message, True)
return "Karma for '{}' is now {}".format(target, self.karma[target])
@re_botcmd(pattern=r'(.+)\+\+', prefixed=False, flags=re.IGNORECASE)
def on_karma_inc(self, message, match):
"""Adds karma"""
self._change_karma(match.group(1), 1, message)
return self._change_karma(match.group(1), 1, message)
@re_botcmd(pattern=r'(.+)--', prefixed=False, flags=re.IGNORECASE)
def on_karma_dec(self, message, match):
"""Removes karma"""
self._change_karma(match.group(1), -1, message)
return self._change_karma(match.group(1), -1, message)
@botcmd
def karma(self, message, args):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment