skip to Main Content

I have my telegram bot deployed on Heroku. Bot used to work fine, but at some point it just stopped sending messages when receiving commands. here is the answer of getWebHookInfo:

{"ok":true,"result":{"url":"https://telegram-rainbow-bot.herokuapp.com:443/api/message/update","has_custom_certificate":false,"pending_update_count":1,"last_error_date":1613676609,"last_error_message":"Wrong response from the webhook: 404 Not Found","max_connections":40,"ip_address":"54.171.62.111"}}

I have no idea what happened. Bot worked as usual, and suddenly that happens. Bot is using port 443 for https requests. Also sometimes logs say "Failed to determine the https port for redirect".

2

Answers


  1. Chosen as BEST ANSWER

    I managed to fix this issue (although I'm not sure if this is correct way). At first, I had problem with error code 404. This one fixes by adding UseRouting() in Configure method at Startup.cs. Then I had problem with error code 400. This one I fixed by installing Microsoft.AspNetCore.Mvc.NewtonsoftJson nuget package and then I added AddControllers().AddNewtonsoftJson() in ConfigureServices method at Startup.cs. Probably my code wasn't processing JSON from Telegram correctly. Hope it helps to anyone.


  2. Its probably because your page is not found.
    https://telegram-rainbow-bot.herokuapp.com/api/message/update not found !
    so fix this and try to set your webbook again

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search