Skip to content
Advertisement

When starting client the code is asking for phone/bot token

While running my first code using Telethon library, it is asking for a bot token.

This is the actual code:

JavaScript

And on command prompt:

JavaScript

Result:

Please enter your phone (or bot token)

If I give my API ID, it eventually throws the error:

telethon.errors.rpcerrorlist.PhoneNumberInvalidError: The phone number is invalid (caused by SendCodeRequest)

Why? I expect the client to start without errors.

PS: my API ID is 7 digits long.

Advertisement

Answer

As the error message suggests, your phone number is invalid. Maybe you didn’t enter it in international format?

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement