From 2ff3a7bb6e493cc5123016c58370469b8359ea40 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 12 May 2020 01:20:47 +0100 Subject: [PATCH] again, there may be more than one (nick,count) --- modules/words.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/words.py b/modules/words.py index 1cbc843b..59b9ef92 100644 --- a/modules/words.py +++ b/modules/words.py @@ -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(