again, there may be more than one (nick,count)

This commit is contained in:
jesopo 2020-05-12 01:20:47 +01:00
parent 158e936ad2
commit 2ff3a7bb6e

View file

@ -203,7 +203,9 @@ class Module(ModuleManager.BaseModule):
user_words = {}
for user_id, word_count in words:
_, nickname = self.bot.database.users.by_id(user_id)
user_words[nickname] = word_count
if not nickname in user_words:
user_words[nickname] = 0
user_words[nickname] += word_count
top_10 = utils.top_10(user_words,
convert_key=lambda nickname: self._get_nickname(