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")
评论列表
文章目录