diff options
| author | 2020-02-19 15:44:16 +0000 | |
|---|---|---|
| committer | 2020-02-19 15:44:16 +0000 | |
| commit | b277463feead861fbe66ae1fa4e0d767faf33159 (patch) | |
| tree | ee2d8295f0a866cc300957d8ad55b88b1cccf1b7 | |
| parent | duck chance should be 5%, not 50% (diff) | |
| signature | ||
show when a badge was updated, not added, by "!badge add"
| -rw-r--r-- | modules/badges.py | 8 |
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: |
