Sign in via Telethon

Question:

I’ve written a script for my friend, which uses Telethon. There I sign in with the following line^

with TelegramClient('test', API_ID, API_HASH) as client:

Well, it actually works with my account and another one, that is not mine. However, my buddy can’t pass the auth. He doesn’t receive verification code, no matter which device or which account he uses.

Have anyone had such an experience? What it can be stemmed from?

EDITED: Linking your account with an email might be of help. I now receive this codes in such a way.

Answers:

You are likely experiencing the same as was reported in Telethon’s issues – Telegram has stopped sending SMS code. Many users have reported this before (linked issues, and probably some more I missed).

As underwhelming as the answer is, it’s probably some server-side check, depending on phone numbers or even location, which Telethon cannot do anything to "fix" it. As far as I’m aware there’s no known workaround (for better of worse, as spammers are also, at least, slowed down by this).

Answered By: Lonami