bot.py 文件源码

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

项目:MusicBot 作者: BjoernPetersen 项目源码 文件源码
def admin_command(self, bot, update):
        chat_id = update.message.chat_id

        admin_chat_id = config.get_state(_admin_key)
        if not admin_chat_id:
            config.save_state(_admin_key, chat_id)
            config.save_secrets()
            text = "You're admin now!"
        elif chat_id == admin_chat_id:
            text = "You already are admin!"
        else:
            bot.send_message(text="There can be only one!", chat_id=chat_id)
            return
        text += "\nHidden comamnds:\n/" + "\n/".join(admin_commands)
        bot.send_message(text=text, chat_id=chat_id)

    # Password protected commands
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号