From a43c5ef1f37fbd8080b4e63e50489e69d6ad12a3 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 20 Dec 2018 20:46:45 +0000 Subject: [PATCH] actually hook in to command for !resetbadge, format datetime to string before putting it in a setting in reset_badge (badges.py) --- modules/badges.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/badges.py b/modules/badges.py index 072102a5..286ba1fc 100644 --- a/modules/badges.py +++ b/modules/badges.py @@ -72,7 +72,8 @@ class Module(ModuleManager.BaseModule): else: event["stderr"].write("You have no '%s' badge" % badge) - def resetbadge(self, event): + @utils.hook("received.command.resetbadge", min_args=1) + def reset_badge(self, event): badge = event["args"] badge_lower = badge.lower() badges = self._get_badges(event["user"]) @@ -84,7 +85,7 @@ class Module(ModuleManager.BaseModule): break if found_badge: - badges[found_badge] = self._now() + badges[found_badge] = self._format_datetime(self._now()) self._set_badges(event["user"], badges) event["stdout"].write("Reset badge '%s'" % badge) else: