settings.py 文件源码

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

项目:mau_mau_bot 作者: jh0ker 项目源码 文件源码
def kb_select(bot, update, groups):
    chat = update.message.chat
    user = update.message.from_user
    option = groups[0]

    if option == '??':
        us = UserSetting.get(id=user.id)
        us.stats = True
        send_async(bot, chat.id, text=_("Enabled statistics!"))

    elif option == '??':
        kb = [[locale + ' - ' + descr]
              for locale, descr
              in sorted(available_locales.items())]
        send_async(bot, chat.id, text=_("Select locale"),
                   reply_markup=ReplyKeyboardMarkup(keyboard=kb,
                                                    one_time_keyboard=True))

    elif option == '?':
        us = UserSetting.get(id=user.id)
        us.stats = False
        us.first_places = 0
        us.games_played = 0
        us.cards_played = 0
        send_async(bot, chat.id, text=_("Deleted and disabled statistics!"))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号