PaulSonOfLars / gotgbot

Autogenerated Go wrapper for the telegram API. Inspired by the python-telegram-bot library.
MIT License
509 stars 115 forks source link

Error: Unexpected end of JSON input in webhook mode #8

Closed Roker2 closed 4 years ago

Roker2 commented 4 years ago

Hi! I updated you package and got this error in logs:

level=info msg="Starting webhook" level=fatal msg="Failed to start bot due to: unexpected end of JSON input" error="unexpected end of JSON input"

If bot use Long Polling mode, it work without any errors.

Roker2 commented 4 years ago

So, I removed this commit and bot work again in webhook mode. https://github.com/PaulSonOfLars/gotgbot/commit/fd45bea9f10530a339f22f67714ea8bb38a89214

PaulSonOfLars commented 4 years ago

That commit doesn't change anything. I've seen this before - it's a weird error that sometimes, and that I haven't found the root cause for yet. Only seen it happen in setwebhook though.

If you try again, with this commit included - can you confirm it still doesn't work?

Roker2 commented 4 years ago

I added it, I got this error again.

Roker2 commented 4 years ago

I understood. It doesn't add "/" symbol. Like this https://calm-cove-01177.herokuapp.comTOKEN But I need to get https://calm-cove-01177.herokuapp.com/TOKEN

Roker2 commented 4 years ago

I opened pull request. https://github.com/PaulSonOfLars/gotgbot/pull/9 I checked https://calm-cove-01177.herokuapp.com and https://calm-cove-01177.herokuapp.com/, it works.

PaulSonOfLars commented 4 years ago

But now, it breaks if you use /text as a path.

PaulSonOfLars commented 4 years ago

This should now be fixed on master, as well as improved error handling to avoid similarly unhelpful errors. Let me know if there's anything else I can help with.

Roker2 commented 4 years ago

Webhook mode is working, thanks!