Add a setting to opt-out of word count tracking

This commit is contained in:
jesopo 2019-05-15 22:44:47 +01:00
parent 052eba788f
commit bf7d359092

View file

@ -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)