fixed username handling and double karma for me

This commit is contained in:
Morgan McMillian 2017-09-15 14:15:04 -07:00
parent e0622d26b0
commit a6b85e6298

View file

@ -36,8 +36,9 @@ def karma_cb(room, event):
return
for mxid in members:
alias = re.search('@([\w]+_)?([^:]+)', mxid).group(2)
alias = re.search('@(pnut_)?([^:]+)', mxid).group(2)
if alias.lower() == handle.lower():
print('match')
if sign == '++':
rs.incr("partybot:k_" + event['room_id'] + "@" + handle)
@ -46,6 +47,8 @@ def karma_cb(room, event):
_show_karma(room, event['room_id'], handle)
break
def _show_karma(room, room_id, handle):