Save when a user sends their "first" words (won't be correct for old users)
This commit is contained in:
parent
527d548743
commit
f8a6aa087b
1 changed files with 5 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import time
|
||||||
import Utils
|
import Utils
|
||||||
|
|
||||||
class Module(object):
|
class Module(object):
|
||||||
|
@ -27,6 +28,10 @@ class Module(object):
|
||||||
user_words = event["channel"].get_user_setting(user.id,
|
user_words = event["channel"].get_user_setting(user.id,
|
||||||
"words", 0)
|
"words", 0)
|
||||||
user_words += word_count
|
user_words += word_count
|
||||||
|
|
||||||
|
if user.get_setting("first-words", None) == None:
|
||||||
|
user.set_setting("first-words", time.time())
|
||||||
|
|
||||||
event["channel"].set_user_setting(user.id,
|
event["channel"].set_user_setting(user.id,
|
||||||
"words", user_words)
|
"words", user_words)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue