Telegram-bot-sdk: Handling pending updates

Created on 10 May 2017  路  5Comments  路  Source: irazasyed/telegram-bot-sdk

I have a problem with this when I have an error from webhook Telegram add the request to pending updates list but when my webhook works fine again I could not empty the pending updates and bot after fill the pending updates list about 40 will blocked by telegram!

"pending_update_count":9,
"last_error_date":1494444307,
"last_error_message":"Wrong response from the webhook: 500 Internal Server Error",
"max_connections":40

anyone could help me please ? how could i handle pending updates?

thanks before

Most helpful comment

@sefidpardazesh for me it was because of some other post which forwarded to my bot for example from Channels, as I could not handle the structure of data my webhook return 500 error and when you respond error back to telegram it will put the request on a queue and pendding updates will count, the only way to prevent this is to respond with status 200 and telegram think you handled the request!

All 5 comments

i have same problem!!
can you solve that???

@sefidpardazesh for me it was because of some other post which forwarded to my bot for example from Channels, as I could not handle the structure of data my webhook return 500 error and when you respond error back to telegram it will put the request on a queue and pendding updates will count, the only way to prevent this is to respond with status 200 and telegram think you handled the request!

how to respond with status 200?

@saeedalzdh
answer, please!!!!
How to respond with status 200?
I have same problem and can't resolved it!!!

You'll have to return a simple response with header status code 200. It could just be echoing some text like Ok and if you have properly set up your tech stack, then the default status code should automatically be applied.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jobs2008 picture jobs2008  路  3Comments

realtebo picture realtebo  路  4Comments

chaskayu picture chaskayu  路  4Comments

b10585 picture b10585  路  4Comments

hafezd picture hafezd  路  3Comments