def cmd_settz(expr, chatid, replyid, msg):
'''/settz - Set your timezone'''
if expr and expr in pytz.all_timezones_set:
update_user(msg['from'], timezone=expr)
sendmsg(_("Your timezone is %s now.") % expr, chatid, replyid)
else:
try:
current = USER_CACHE[msg['from']['id']]['timezone']
except KeyError:
current = CFG['defaulttz']
sendmsg(_("Invalid timezone. Your current timezone is %s.") % current, chatid, replyid)
评论列表
文章目录