From a33df8f28ae662d9507d074d9f2cd4fc77444ab6 Mon Sep 17 00:00:00 2001 From: mctaylors Date: Sun, 1 Jun 2025 23:05:40 +0300 Subject: [PATCH] fix: do not send a new message when an error occurs --- commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands.py b/commands.py index ad719d7..4a444cc 100644 --- a/commands.py +++ b/commands.py @@ -60,8 +60,10 @@ async def info_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No ) post_data = get_json(f"posts/{post_id}") if post_data is None: - await update.message.reply_text( + await context.bot.edit_message_text( f"{html_parser.bold("Error")}: That record was not found.", + update.effective_chat.id, + message.message_id, parse_mode=ParseMode.HTML, ) return