alexander-akhmetov/python-telegram

Stuck on "Enter code:"

danielaixer opened this issue · 1 comments

I'm running a small script to attempt to log in, using this code as a base, but with my own values:

from telegram.client import Telegram
from telegram.text import Spoiler

tg = Telegram(
    api_id='api_id',
    api_hash='api_hash',
    phone='+31611111111',  # you can pass 'bot_token' instead
    database_encryption_key='changekey123',
    files_directory='/tmp/.tdlib_files/',
)
tg.login()

The console output is this:

[ 2][t 4][1709914761.586864948][AuthDataShared.cpp:107][#1][!Td]	DcId{4} [auth_key_id:(REMOVED-FOR-PRIVACY)][state:NoAuth][created_at:1709913570.000000]
[ 2][t 4][1709914761.587391614][Session.cpp:242][#1][!SessionProxy:4:main]	Generate new session_id (REMOVED-FOR-PRIVACY) for auth key (REMOVED-FOR-PRIVACY) for main DC4
Enter code:

However, I get no SMS code nor in the app.

Apparently, there should be some other command to retrieve this code, but I don't know how to get it.

Thanks in advance.

OK, never mind.

I was getting the codes but NO notification, so I thought I was receiving nothing...

I just found the codes from the other day and I also tried to log in now and got a working code.