Answer the question
In order to leave comments, you need to log in
What to choose for a telegram bot? Webhooks or long polling?
I didn't write telegram bots. The task is this. You need to write a bot in Go, to which you send a voice message, and it processes this audio and responds with text. For audio processing, I will contact another service via grpc.
I have a question. What to use? If the Internet does not lie, then there are two options. Longpolling or webhooks. As I understand it, 100% of tasks are better than webhooks. But I suspect I'm wrong. What is best for my case?
Answer the question
In order to leave comments, you need to log in
"Long polling" periodically polls the telegram server, due to this it will seem to the user that the bot is "slowing down", because. there will be pauses between sending a message from the user and receiving a response.
At least that's how it was for me.
It is also worth mentioning that "Long polling" will not work when it comes to loads.
After switching to WebHooks, everything immediately worked very quickly.
Also, using WebHooks, you will be able to horizontally scale the bot in case of increased loads.
If I had such a task, I would use WebHooks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question