From bf7d3590928da68217f015b7ab034d3f462857a3 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 15 May 2019 22:44:47 +0100 Subject: [PATCH] Add a setting to opt-out of word count tracking --- modules/words.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/words.py b/modules/words.py index c454bd0a..c9798712 100644 --- a/modules/words.py +++ b/modules/words.py @@ -5,8 +5,14 @@ WORD_DELIM = "\"'…~*`" WORD_START = WORD_DELIM+"“({<" WORD_STOP = WORD_DELIM+"”)}>;:.,!?" +@utils.export("set", {"setting": "word-tracking", + "help": "Disable/enable tracking your wordcounts", + "validate": utils.bool_or_none}) class Module(ModuleManager.BaseModule): def _channel_message(self, user, event): + if not user.get_setting("word-tracking", True): + return + words = list(filter(None, event["message_split"])) word_count = len(words)