From ce4f0f68b00bda798c5f813ca88b428572cf76c7 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 18 Apr 2016 16:51:06 +0100 Subject: [PATCH] fixed words.py to always show nicknames with the same count in the same order. --- modules/words.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/words.py b/modules/words.py index 55d43060..40ad38c6 100644 --- a/modules/words.py +++ b/modules/words.py @@ -69,7 +69,8 @@ class Module(object): word = event["args_split"][0].lower() if word in event["server"].tracked_words: word_users = event["server"].get_setting("word-%s" % word) - top_10 = sorted(word_users, key=word_users.get, reverse=True)[:10] + top_10 = sorted(word_users.keys()) + top_10 = sorted(top_10, key=word_users.get, reverse=True)[:10] top_10 = ", ".join("%s (%d)" % (nickname, word_users[nickname ]) for nickname in top_10) event["stdout"].write("Top '%s' users: %s" % (word, top_10))