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

I cannot log in as a bot #2726

Closed mahmoud-syr closed 10 months ago

mahmoud-syr commented 10 months ago

I am trying to use tdsharp as a wrapper around the tdlib API for .NET. Whenever I try to call CheckAuthenticationBotTokenAsync with my bot-token. I get the error: TdLib.TdException: 'ACCESS_TOKEN_INVALID' although the exact same token is used for Bot API and it's working just fine.

Would be nice to get help here since the documentation is super confusing and there is no direction for people like me as to where to go.

Thanks in advance.

levlam commented 10 months ago

Are you sure that you use the correct token as provided by BotFather starting with digits and not "bot"? Did you correctly specify use_test_dc == false in setTdlibParameters?

mahmoud-syr commented 10 months ago

Are you sure that you use the correct token as provided by BotFather starting with digits and not "bot"? Did you correctly specify use_test_dc == false in setTdlibParameters?

Dear @levlam Thanks for your reply I was able to find the issue, yes indeed I was using use_test_dc to true. I thought it sort of make sense, since I am actually testing locally. Any reason why it doesn't if we are passing use_test_dc = true?

Anyways this can be safely closed. Thanks alot!

levlam commented 10 months ago

Test environment is a completely independent environment. You can create accounts and bots there independently and can transfer no data between test and production environment.

mahmoud-syr commented 10 months ago

Test environment is a completely independent environment. You can create accounts and bots there independently and can transfer no data between test and production environment.

Thanks for the clarification @levlam