diff options
| author | 2019-09-08 18:22:04 +0100 | |
|---|---|---|
| committer | 2019-09-08 18:22:04 +0100 | |
| commit | b1033a07210637ecd18cf7f2e501c4b6b46f78cb (patch) | |
| tree | 8615193eef4031f1d4b0d66c6993a7c11f146c96 /modules | |
| parent | support showing time for locations, not just users (diff) | |
| signature | ||
support location names for !timezone too
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/user_time.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/user_time.py b/modules/user_time.py index 065d971d..8ea8b480 100644 --- a/modules/user_time.py +++ b/modules/user_time.py @@ -72,9 +72,13 @@ class Module(ModuleManager.BaseModule): @utils.kwarg("require_setting", "location") @utils.kwarg("require_setting_unless", "1") def timezone(self, event): - target_user, location = self._find_setting(event) - if not location == None: - event["stdout"].write("%s is in %s" % (target_user.nickname, - location["timezone"])) + type, name, timezone = self._find_setting(event) + if not timezone == None: + event["stdout"].write("%s is in %s" % (name, timezone)) else: - event["stderr"].write(NOLOCATION % target_user.nickname) + out = None + if type == LocationType.USER: + out = NOLOCATION_USER + else: + out = NOLOCATION_NAME + event["stderr"].write(out % name) |
