/ webhook that the message with sendMessage has been written?
I'll explain the code:
If in the chat with the bot I write "ok"
A) with the sendMessage () method the bot writes "hi"
B) includes a php file that parses an array and for each element the bot writes a message in the chat, with sendMessage ():
"1" (index == 0)
"2" (index == 0)
"3" (index == 0)
"4" (index == 0)
The bot should stop and write "4" as the last message but in reality this does not happen! He suddenly writes "hi" again as if someone wrote "ok" again.
In short, it is an infinite loop.
But I write "ok" once so this problem (infinite loop) shouldn't happen.
Let us see the for each
you should answer the webhook request with a 2XX, i think your server will be probably answering 500 timeout errors, to Telegram, and Telegram will keep re sending the updates till you answer back any 2XX response.
Обсуждают сегодня