support disabling word tracking per channel, not just per user
This commit is contained in:
parent
a9d11fc7f8
commit
bad108d7ce
1 changed files with 7 additions and 3 deletions
|
@ -9,11 +9,15 @@ WORD_DELIM = "\"'…~*`"
|
|||
WORD_START = WORD_DELIM+"“({<"
|
||||
WORD_STOP = WORD_DELIM+"”)}>;:.,!?"
|
||||
|
||||
@utils.export("set", utils.BoolSetting(
|
||||
"word-tracking", "Disable/enable tracking your wordcounts"))
|
||||
SETTING = utils.BoolSetting("word-tracking",
|
||||
"Disable/enable tracking your wordcounts")
|
||||
|
||||
@utils.export("set", SETTING)
|
||||
@utils.export("channelset", SETTING)
|
||||
class Module(ModuleManager.BaseModule):
|
||||
def _channel_message(self, user, event):
|
||||
if not user.get_setting("word-tracking", True):
|
||||
if not event["channel"].get_setting("word-tracking", True
|
||||
) or not user.get_setting("word-tracking", True):
|
||||
return
|
||||
|
||||
words = list(filter(None, event["message_split"]))
|
||||
|
|
Loading…
Reference in a new issue