Added help command
This commit is contained in:
		@@ -35,4 +35,7 @@ def create_bot(token: str, engine: mariadb.Connection) -> telebot.TeleBot:
 | 
				
			|||||||
        functools.partial(handlers.delete_account, bot, engine),
 | 
					        functools.partial(handlers.delete_account, bot, engine),
 | 
				
			||||||
        commands=["delete_account"],
 | 
					        commands=["delete_account"],
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					    bot.register_message_handler(
 | 
				
			||||||
 | 
					        functools.partial(handlers.help, bot), commands=["help", "start"]
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
    return bot
 | 
					    return bot
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -167,3 +167,15 @@ def delete_account(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    database.delete.delete_account(engine, mes.from_user.id, data[1])
 | 
					    database.delete.delete_account(engine, mes.from_user.id, data[1])
 | 
				
			||||||
    _send_tmp_message(bot, mes.chat.id, "Аккаунт удалён")
 | 
					    _send_tmp_message(bot, mes.chat.id, "Аккаунт удалён")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def help(bot: telebot.TeleBot, mes: telebot.types.Message) -> None:
 | 
				
			||||||
 | 
					    message = """Команды:
 | 
				
			||||||
 | 
					/set_master_pass {Мастер пароль} - установить мастер пароль
 | 
				
			||||||
 | 
					/add_account {Название} {Логин} {Пароль} {Мастер пароль} - создать аккаунт
 | 
				
			||||||
 | 
					/get_accounts - получить список аккаунтов
 | 
				
			||||||
 | 
					/get_account {Название} {Мастер пароль} - получить логин и пароль аккаунта
 | 
				
			||||||
 | 
					/delete_account {Название} - удалить аккаунт
 | 
				
			||||||
 | 
					/delete_all - удалить все аккаунты и мастер пароль
 | 
				
			||||||
 | 
					/reset_master_pass {Новый мастер пароль} - удалить все аккаунты и изменить мастер пароль"""
 | 
				
			||||||
 | 
					    bot.send_message(mes.chat.id, message)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user