Compare commits
2 commits
57f591d0a2
...
2a05edf78d
Author | SHA1 | Date | |
---|---|---|---|
2a05edf78d | |||
b0ad45e935 |
1 changed files with 23 additions and 13 deletions
|
@ -154,8 +154,18 @@ def karma(room):
|
|||
reply = "Karma standings\n\n"
|
||||
results = Karma.query.filter(Karma.chanid == room).order_by(Karma.karma.desc()).all()
|
||||
for entry in results:
|
||||
try:
|
||||
user, meta = pnutpy.api.get_user(entry.userid)
|
||||
reply += user.username + ": " + str(entry.karma) + "\n"
|
||||
|
||||
except pnutpy.errors.PnutMissing:
|
||||
del_karma = Karma.query.filter(Karma.userid == entry.userid).one_or_none()
|
||||
if del_karma:
|
||||
db_session.delete(del_karma)
|
||||
del_counter = MdnpRequests.query.filter(MdnpRequests.userid == entry.userid).one_or_none()
|
||||
if del_counter:
|
||||
db_session.delete(del_counter)
|
||||
db_session.commit()
|
||||
send(room, reply)
|
||||
|
||||
def chimpnut(msg):
|
||||
|
|
Loading…
Reference in a new issue