Calling a getMe request during init of TeleBot class #2312
Replies: 3 comments 1 reply
-
I just don't see any reasonable consequences of this either - users have to pass valid token. Currently we are not validating token passed for mysterious reasons. Starting to validate it right away could cause some issues for some, but it would be their problem for relying on absence of validation 🤷♂️ |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I've done this manually before, then removed it because it delayed my bot start by like 6 seconds. Now that info is stored in my database and fetched from there to avoid weird long startup delays. |
Beta Was this translation helpful? Give feedback.
-
@Badiboy do you think it is reasonable to call getMe when initialising TeleBot class? Then assign self._user with the result?
Do you think this is a good idea or should the token check be postponed until polling starts?
The problem with just postponing it to polling is that webhook usage should also be monitored, which creates an unnecessary mess. Maybe checking for a valid token right away would be correct, or would it result in even more problems?
I need it for a feature update too
Beta Was this translation helpful? Give feedback.
All reactions