add a setting to only track words from registered users

This commit is contained in:
jesopo 2020-02-06 16:52:09 +00:00
parent e0e31b977e
commit 83bc75c9cc

View file

@ -11,9 +11,13 @@ WORD_STOP = WORD_DELIM+"”)}>;:.,!?"
SETTING = utils.BoolSetting("word-tracking",
"Disable/enable tracking your wordcounts")
REGISTERED_SETTING = utils.BoolSetting("word-tracking-registered",
"Whether or not word tracking is registered-users-only")
@utils.export("set", SETTING)
@utils.export("channelset", SETTING)
@utils.export("serverset", REGISTERED_SETTING)
@utils.export("channelset", REGISTERED_SETTING)
@utils.export("channelset", utils.BoolSetting("words-prevent-highlight",
"Whether or not to prevent highlights in wordiest lists"))
class Module(ModuleManager.BaseModule):
@ -60,6 +64,11 @@ class Module(ModuleManager.BaseModule):
) or not user.get_setting("word-tracking", True):
return
if event["channel"].get_setting("word-tracking-registered",
event["server"].get_setting("word-tracking-registered", False)):
if not self.exports.get_one("is-identified")(event["user"]):
return
if user.get_setting("first-words", None) == None:
user.set_setting("first-words", time.time())