From 158e936ad278f740d9780c7dcbf85ea0569f44ff Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 12 May 2020 01:16:34 +0100 Subject: turing (chan_id,count) in to a dict loses different days --- modules/words.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/words.py b/modules/words.py index 0ee1c5a9..1cbc843b 100644 --- a/modules/words.py +++ b/modules/words.py @@ -115,11 +115,14 @@ class Module(ModuleManager.BaseModule): else: target_user = event["user"] - words = dict(self._user_all(target_user)) - - total = 0 - for channel_id in words: - total += words[channel_id] + word_items = self._user_all(target_user) + + words = {} + for channel_id, count in word_items: + if not channel_id in words: + words[channel_id] = 0 + words[channel_id] += count + total = sum(words.values()) since = "" first_words = target_user.get_setting("first-words", None) -- cgit v1.3.1-10-gc9f91