Added ability to copy account name from /get_accounts
That also fixed an issue of having wrong behaviour, if using any special chars in account name
This commit is contained in:
parent
4122e15308
commit
adf9865fbe
@ -20,15 +20,19 @@ Message = telebot.types.Message
|
||||
def get_accounts(
|
||||
bot: telebot.TeleBot, engine: Engine, mes: telebot.types.Message
|
||||
) -> None:
|
||||
base_handler(bot, mes)
|
||||
accounts = database.get.get_accounts(engine, mes.from_user.id)
|
||||
bot.delete_message(mes.chat.id, mes.id)
|
||||
|
||||
return send_tmp_message(
|
||||
bot,
|
||||
mes.chat.id,
|
||||
"Ваши аккаунты:\n" + "\n".join(accounts) if accounts else "У вас нет аккаунтов",
|
||||
timeout=30,
|
||||
)
|
||||
if accounts:
|
||||
accounts = [f"`{account}`" for account in accounts]
|
||||
return send_tmp_message(
|
||||
bot,
|
||||
mes.chat.id,
|
||||
"Ваши аккаунты:\n"
|
||||
+ "\n".join(accounts)
|
||||
+ "\nНажмите на название, чтобы скопировать",
|
||||
30,
|
||||
)
|
||||
send_tmp_message(bot, mes.chat.id, "У вас нет аккаунтов")
|
||||
|
||||
|
||||
def delete_all(
|
||||
|
Reference in New Issue
Block a user