skip to Main Content

I’m working on a Python project that uses Telethon to connect to Telegram. I have the following code for authentication:

client = TelegramClient(phone, api_id, api_hash, flood_sleep_threshold=3)
client.connect()
if not client.is_user_authorized():
    client.send_code_request(phone)
    client.sign_in(phone, input(f'Enter the code: {phone} : '))

The issue I’m facing is that even when I enter the correct code, Telegram blocks my login attempt with the following message:

Telegram blocked an attempt to log in to your account from a new device on 23/10/2023 20:48:02 UTC.

Device: chatbot, 1.31.0, PC 64bit, Android, 4.18.0
Location: Germany (IP = .......)

No one could access your chats because the login was not completed. The code was entered correctly, but login was not allowed because this code was previously shared by your account.

Has anyone encountered a similar issue or can provide insights into why this might be happening? I’m sure the code is correct, but it seems like there’s some sort of restriction or block on my account. How can I resolve this and successfully log in using Telethon?

2

Answers


  1. You check if the device has remote control enabled like teamviewer. Just close and it will be ok.

    Login or Signup to reply.
  2. can u resolve this problem, I have been had trouble resolving

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search