tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Creating bots #2741

Closed chjrco closed 10 months ago

chjrco commented 10 months ago

I'm quite confused on how to create bots rather than clients. When listening for AuthorizationStateWaitTdlibParameters it requires me to set api hash and api token, where do I find those for the bot? Do I use my personal account's? If I do that it just logs into my account and I cant "register as a bot" nor call CheckAuthenticationBotToken

levlam commented 10 months ago

Do I use my personal account's?

Yes, you create them at api.telegram.org.

To log in as a bot you need to call checkAuthenticationBotToken in the state authorizationStateWaitPhoneNumber.