async def check_last_media_file(message: Message):
last_message_flag = False
try:
await message.bot.edit_message_text(
text=" ",
chat_id=message.from_user.id,
message_id=message.message_id + 1
)
except TelegramBadRequest as exc:
if (exc.message == "Bad Request: message must be non-empty" or
exc.message == "Bad Request: message to edit not found"):
last_message_flag = True
return last_message_flag