Improve using correct nickname capitalisation in words.py

This commit is contained in:
jesopo 2018-08-05 13:14:40 +01:00
parent 7698105761
commit c2c60e309a

View file

@ -71,10 +71,9 @@ class Module(object):
top_10 = sorted(word_users.keys())
top_10 = sorted(top_10, key=word_users.get, reverse=True)[:10]
top_10 = [event["server"].get_user(nickname
).nickname for nickname in top_10]
top_10 = ", ".join("%s (%d)" % (nickname, word_users[
nickname.lower()]) for nickname in top_10)
top_10 = ", ".join("%s (%d)" % (event["server"].get_user(
nickname).nickname, word_users[nickname]
) for nickname in top_10)
event["stdout"].write("Top '%s' users: %s" % (word, top_10))
else:
event["stderr"].write("That word is not being tracked")