Hi, I would like to delete a message that I sent via a script, on my Telegram bot after a set time.
To do this I need to have the message_id parameter of the message sent on Telegram. I’ve been looking around here, and the only way I’ve found to retrieve the message_id is to have an automation whose trigger has this code:
message_id: '{{ trigger.event.data.message.message_id }}'
which is activated when a key is pressed in the message already sent on telegram via inline_keyboard and therefore activates the event_type: telegram_callback event.
I would like to be able to recover the message_id to delete commands sent on Telegram after a minute, when no response has been given.
It is not good to delete the last message, because in the meantime other messages may have been sent and the one with the commands may not be the last.
Is there a way to get the message_id, possibly while running the script that sends it?