Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Telegram Bot API Web hook repeated infinitely?

I using laravel and php bot sdk for my bot. here is the laravel route code :

Route::post('268XXXX:XXXXXX/webhook',function(){
Telegram::commandsHandler(true);
Telegram::setWebHook(['url'=>URL::to('/').'/268XXXX:XXXXXX/webhook']);
return response()->json("{}")->setStatusCode(200);

});

and help command executed infinitely!

like image 446
unbl0ck3r Avatar asked Nov 08 '25 08:11

unbl0ck3r


1 Answers

When Telegram send an update to your server, if your server return any status except 200, then Telegram consider that you doesn't notify about the update, so Telegram repeat the update continuously!

Also some times; an error accrues in your code execution and code stopped at the certain line. In these case, you can save & check update_id of received update in database, at first lines of your program, so you can ignore such repeated updates.

like image 160
علیرضا Avatar answered Nov 10 '25 02:11

علیرضا



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!