tsleepd.py 文件源码

python
阅读 52 收藏 0 点赞 0 评论 0

项目:trustedsleepbot 作者: gumblex 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号