Quality of life changes
Changed default action of /cancel to be handled at message_handler Added keyboard markup to get_account for easier account selection
This commit is contained in:
@ -7,6 +7,11 @@ from . import markups
|
||||
|
||||
Message = telebot.types.Message
|
||||
Handler = Callable[[Message], Awaitable[Any]]
|
||||
Markups = (
|
||||
telebot.types.ReplyKeyboardMarkup
|
||||
| telebot.types.InlineKeyboardMarkup
|
||||
| telebot.types.ReplyKeyboardRemove
|
||||
)
|
||||
states: dict[tuple[int, int], Handler] = {}
|
||||
|
||||
|
||||
@ -48,9 +53,13 @@ async def send_tmp_message(
|
||||
bot: AsyncTeleBot,
|
||||
chat_id: telebot.types.Message,
|
||||
text: str,
|
||||
*,
|
||||
sleep_time: int = 5,
|
||||
markup: Markups | None = None,
|
||||
) -> None:
|
||||
bot_mes = await bot.send_message(chat_id, text, parse_mode="MarkdownV2")
|
||||
bot_mes = await bot.send_message(
|
||||
chat_id, text, parse_mode="MarkdownV2", reply_markup=markup
|
||||
)
|
||||
await delete_message(bot, bot_mes, sleep_time=sleep_time)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user