E
E
emanuelan2021-12-01 14:38:29
Python
emanuelan, 2021-12-01 14:38:29

How to solve Telethon client startup error?

Hi everyone and thanks in advance for your reply.
I'm pissed off with the code to launch the Telegram client with Telethon:

import re
from decimal import Decimal
import time
import requests
from telethon.tl.functions.messages import GetHistoryRequest
from telethon.tl.functions.contacts import ResolveUsernameRequest
from telethon.tl.functions.channels import GetMessagesRequest
from telethon.tl.functions.messages import GetHistoryRequest, ReadHistoryRequest
from telethon import TelegramClient, events, sync
import telethon.sync
from telethon.tl.types import PeerUser, PeerChat, PeerChannel
import asyncio

api_id = 
api_hash = ''

client = TelegramClient('name, api_id, api_hash)
client.start()
client.send_message('me', f'Успешная авторизация')
client.disconnect()


The problem is that when you run the script, the client does not start and crashes with an error:
61a75eb32870e428185253.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2021-12-01
@emanuelan

No way, wait for a new version of the library.

Telegram has started enforcing the use of 64-bit identifiers for users and chats, and the current stable version of the library does not support them yet. If you try to login, you may see UPDATE_APP_TO_LOGIN error.

G
gresaggr, 2021-12-03
@gresaggr

To update the library in the terminal (command line) write:
pip install -U telethon (pip3 install -U telethon)
This will update the version to the latest 1.24.0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question