I have implemented a restart command in my bot. When I issue the command /restart, in my code this is interpreted and an ESP.restart()command is issued. Apparently the message queue is not cleared because after restart the first message received is /restart and again an ESP.restart() command is issued. This results in an endless loop.
I can break the restart loop by sending the command https://api.telegram.org/bot_token/getUpdates in a web browser, noting the update_id, incrementing it by1, then send the command https://api.telegram.org/bot_token/getUpdates?offset=<update_id+1> How can I programmatically update the message queue before issuing the ESP.restart() command? I tried
I have implemented a restart command in my bot. When I issue the command
/restart
, in my code this is interpreted and anESP.restart()
command is issued.Apparently the message queue is not cleared because after restart the first message received is
/restart
and again anESP.restart()
command is issued.This results in an endless loop. I can break the restart loop by sending the command
https://api.telegram.org/bot_token/getUpdates
in a web browser, noting the update_id, incrementing it by1, then send the commandhttps://api.telegram.org/bot_token/getUpdates?offset=<update_id+1>
How can I programmatically update the message queue before issuing the
ESP.restart()
command?I tried
but that does not work.