fix: do not send a new message when an error occurs
All checks were successful
Build / Upload to production (push) Successful in 1m42s

This commit is contained in:
Macintxsh 2025-06-01 23:05:40 +03:00
parent 46cd965913
commit a33df8f28a
Signed by: mctaylors
GPG key ID: 4EEF4F949A266EE2

View file

@ -60,8 +60,10 @@ async def info_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
) )
post_data = get_json(f"posts/{post_id}") post_data = get_json(f"posts/{post_id}")
if post_data is None: 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.", f"{html_parser.bold("Error")}: That record was not found.",
update.effective_chat.id,
message.message_id,
parse_mode=ParseMode.HTML, parse_mode=ParseMode.HTML,
) )
return return