Add a setting to opt-out of word count tracking
This commit is contained in:
parent
052eba788f
commit
bf7d359092
1 changed files with 6 additions and 0 deletions
|
@ -5,8 +5,14 @@ WORD_DELIM = "\"'…~*`"
|
||||||
WORD_START = WORD_DELIM+"“({<"
|
WORD_START = WORD_DELIM+"“({<"
|
||||||
WORD_STOP = 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):
|
class Module(ModuleManager.BaseModule):
|
||||||
def _channel_message(self, user, event):
|
def _channel_message(self, user, event):
|
||||||
|
if not user.get_setting("word-tracking", True):
|
||||||
|
return
|
||||||
|
|
||||||
words = list(filter(None, event["message_split"]))
|
words = list(filter(None, event["message_split"]))
|
||||||
word_count = len(words)
|
word_count = len(words)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue