aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2020-02-19 15:44:16 +0000
committerGravatar jesopo2020-02-19 15:44:16 +0000
commitb277463feead861fbe66ae1fa4e0d767faf33159 (patch)
treeee2d8295f0a866cc300957d8ad55b88b1cccf1b7 /modules
parentduck chance should be 5%, not 50% (diff)
signature
show when a badge was updated, not added, by "!badge add"
Diffstat (limited to 'modules')
-rw-r--r--modules/badges.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/badges.py b/modules/badges.py
index a6d76ee5..21531c7c 100644
--- a/modules/badges.py
+++ b/modules/badges.py
@@ -60,10 +60,14 @@ class Module(ModuleManager.BaseModule):
dt = utils.datetime.utcnow()
else:
dt = event["spec"][2]
+
+ exists = event["spec"][1] in badges
+ action = "updated" if exists else "added"
+
badges[event["spec"][1]] = utils.datetime.format.iso8601(dt)
human = utils.datetime.format.date_human(dt)
- event["stdout"].write("%s: added badge %s (%s)"
- % (event["user"].nickname, event["spec"][1], human))
+ event["stdout"].write("%s: %s badge %s (%s)"
+ % (event["user"].nickname, action, event["spec"][1], human))
elif event["spec"][0] == "remove":
if not event["spec"][1] in badges: