Skip to content

Commit

Permalink
[clock, tools] Additional tweaks to timezone getting
Browse files Browse the repository at this point in the history
  • Loading branch information
embolalia committed Feb 2, 2014
1 parent 3acff29 commit 0c25c0e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ def setup(bot):
@example('.t America/New_York')
def f_time(bot, trigger):
"""Returns the current time."""
zone = get_timezone(bot.db, bot.config, trigger.group(2), trigger.nick,
trigger.sender)
if trigger.group(2):
zone = get_timezone(bot.db, bot.config, trigger.group(2), None, None)
if not zone:
bot.say('oops')
return
else:
zone = get_timezone(bot.db, bot.config, None, trigger.nick,
trigger.sender)
time = format_time(bot.db, bot.config, zone, trigger.nick, trigger.sender)
bot.say(time)

Expand Down

0 comments on commit 0c25c0e

Please sign in to comment.