aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-15 12:13:16 +0000
committerGravatar jesopo2019-11-15 12:13:16 +0000
commit2cb55306c3155a317223a500f814259e77445325 (patch)
tree841f71805d826103b506ea3ed21d492177e9d231 /modules
parentimplement opt-in shlex for command args (diff)
signature
show first-words datestamp on !words output
Diffstat (limited to 'modules')
-rw-r--r--modules/words.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/words.py b/modules/words.py
index 1e07971c..520f05fc 100644
--- a/modules/words.py
+++ b/modules/words.py
@@ -75,8 +75,15 @@ class Module(ModuleManager.BaseModule):
total = 0
for channel in words:
total += words[channel]
- event["stdout"].write("%s has used %d words (%d in %s)" % (
- target.nickname, total, this_channel, event["target"].name))
+
+ since = ""
+ first_words = target.get_setting("first-words", None)
+ if not first_words == None:
+ since = " since %s" % utils.date_human(
+ utils.datetime_timestamp(first_words))
+
+ event["stdout"].write("%s has used %d words (%d in %s)%s" % (
+ target.nickname, total, this_channel, event["target"].name, since))
@utils.hook("received.command.trackword", min_args=1)
def track_word(self, event):