bot.py 文件源码

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

项目:MusicBot 作者: BjoernPetersen 项目源码 文件源码
def set_password_command(self, bot, update):
        chat_id = update.message.chat_id
        if not config.get_state(_password_enabled_key):
            bot.send_message(chat_id=chat_id, text="Please enable password protection with /togglepassword first")
            return

        split = update.message.text.split(" ")
        if len(split) < 2:
            bot.send_message(chat_id=chat_id, text="Usage: /setpassword [password]")
            return

        password = split[1].strip()
        if not password:
            bot.send_message(chat_id=chat_id, text="Password can't be empty")
            return

        global _password
        _password = password
        _clients.add(User(user=update.message.from_user))
        bot.send_message(chat_id=chat_id, text="Successfully changed password")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号