LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!
https://docs.telethon.dev
MIT License
10.01k stars 1.41k forks source link

bot is getting disconnected everytime i try to run it. (i have python 10.8) #3991

Closed sohan-04 closed 1 year ago

sohan-04 commented 1 year ago

Checklist

Code that causes the issue

from telethon.sync import TelegramClient
...

Traceback

Traceback (most recent call last):
2022-12-01 07:26:10,016 - telethon.network.mtprotosender - INFO - Connecting to 91.108.56.100:443/TcpFull...
2022-12-01 07:26:10,132 - telethon.network.mtprotosender - INFO - Connection to 91.108.56.100:443/TcpFull complete!
2022-12-01 07:26:12,617 - telethon.network.mtprotosender - INFO - Disconnecting from 91.108.56.100:443/TcpFull...
2022-12-01 07:26:12,618 - telethon.network.mtprotosender - INFO - Disconnection from 91.108.56.100:443/TcpFull complete!
Traceback (most recent call last):
  File "c:\Users\sohan\OneDrive\Desktop\Token-Buy-Tracker-TelegramBot-main\tracker.py", line 141, in <module>
    tracker()
  File "c:\Users\sohan\OneDrive\Desktop\Token-Buy-Tracker-TelegramBot-main\tracker.py", line 129, in tracker
    chat = BOT.get_entity(CHANNEL)
  File "C:\Users\sohan\AppData\Local\Programs\Python\Python310\lib\site-packages\telethon\sync.py", line 39, in syncified
    return loop.run_until_complete(coro)
  File "C:\Users\sohan\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "C:\Users\sohan\AppData\Local\Programs\Python\Python310\lib\site-packages\telethon\client\users.py", line 335, in get_entity
    result.append(await self._get_entity_from_string(x))
  File "C:\Users\sohan\AppData\Local\Programs\Python\Python310\lib\site-packages\telethon\client\users.py", line 553, in _get_entity_from_string
    result = await self(
  File "C:\Users\sohan\AppData\Local\Programs\Python\Python310\lib\site-packages\telethon\client\users.py", line 30, in __call__
    return await self._call(self._sender, request, ordered=ordered)
  File "C:\Users\sohan\AppData\Local\Programs\Python\Python310\lib\site-packages\telethon\client\users.py", line 63, in _call
    future = sender.send(request, ordered=ordered)
  File "C:\Users\sohan\AppData\Local\Programs\Python\Python310\lib\site-packages\telethon\network\mtprotosender.py", line 177, in send
    raise ConnectionError('Cannot send requests while disconnected')
ConnectionError: Cannot send requests while disconnected
Lonami commented 1 year ago

Please follow the issue template. Otherwise it's very hard to help.I am closing this as there doesn't seem to be a bug.