tgbot-cpp
tgbot-cpp copied to clipboard
Question about polling
I need my bot to respond to events and while I can do that inside the long poll loop, the poll itself takes a bit of time before it returns. Is there a way to set the timeout or is there a short poll equivalent, etc?
-
look at the TgLongPoll declaration to set up upper limit https://github.com/reo7sp/tgbot-cpp/blob/f2d7dc110d3ba37914298bd073500396fcf93967/src/net/TgLongPoll.cpp
-
check network latency from your machine to TG API endpoint
-
measure time not from app start, but from longpoll start, so you will see how many ms being spent for app load on top of network latency and longpoll spin-up delay