settings.py 文件源码

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

项目:mau_mau_bot 作者: jh0ker 项目源码 文件源码
def show_settings(bot, update):
    chat = update.message.chat

    if update.message.chat.type != 'private':
        send_async(bot, chat.id,
                   text=_("Please edit your settings in a private chat with "
                          "the bot."))
        return

    us = UserSetting.get(id=update.message.from_user.id)

    if not us:
        us = UserSetting(id=update.message.from_user.id)

    if not us.stats:
        stats = '??' + ' ' + _("Enable statistics")
    else:
        stats = '?' + ' ' + _("Delete all statistics")

    kb = [[stats], ['??' + ' ' + _("Language")]]
    send_async(bot, chat.id, text='??' + ' ' + _("Settings"),
               reply_markup=ReplyKeyboardMarkup(keyboard=kb,
                                                one_time_keyboard=True))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号