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(
|
def get_accounts(
|
||||||
bot: telebot.TeleBot, engine: Engine, mes: telebot.types.Message
|
bot: telebot.TeleBot, engine: Engine, mes: telebot.types.Message
|
||||||
) -> None:
|
) -> None:
|
||||||
|
base_handler(bot, mes)
|
||||||
accounts = database.get.get_accounts(engine, mes.from_user.id)
|
accounts = database.get.get_accounts(engine, mes.from_user.id)
|
||||||
bot.delete_message(mes.chat.id, mes.id)
|
if accounts:
|
||||||
|
accounts = [f"`{account}`" for account in accounts]
|
||||||
return send_tmp_message(
|
return send_tmp_message(
|
||||||
bot,
|
bot,
|
||||||
mes.chat.id,
|
mes.chat.id,
|
||||||
"Ваши аккаунты:\n" + "\n".join(accounts) if accounts else "У вас нет аккаунтов",
|
"Ваши аккаунты:\n"
|
||||||
timeout=30,
|
+ "\n".join(accounts)
|
||||||
|
+ "\nНажмите на название, чтобы скопировать",
|
||||||
|
30,
|
||||||
)
|
)
|
||||||
|
send_tmp_message(bot, mes.chat.id, "У вас нет аккаунтов")
|
||||||
|
|
||||||
|
|
||||||
def delete_all(
|
def delete_all(
|
||||||
|
Reference in New Issue
Block a user