LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!

Home Page:https://docs.telethon.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I am got Logoff on phone after closing running file

Artemyu45 opened this issue · comments

Code that causes the issue

from telethon import TelegramClient, events

api_id = id
hash_id = hash

client = TelegramClient('anon', api_id, hash_id)

@client.on(events.NewMessage(outgoing=True, pattern=r'.save'))
async def handler(event):
if event.is_reply:
replied = await event.get_reply_message()
sender = replied.sender
await client.download_profile_photo(sender)
await event.respond('Saved your photo {}'.format(sender.username))

@client.on(events.)

client.start()
client.run_until_disconnected()

Expected behavior

After stopping code I was expected just stop working this, not kicking me

Actual behavior

I ran code, then did some commands and when i closed it i logged off on my phone from telegram. That happens every time/

Traceback

No response

Telethon version

1.35.0

Python version

3.12

Operating system (including distribution name and version)

Windows 10

Other details

No response

Checklist

  • The error is in the library's code, and not in my own.
  • I have searched for this issue before posting it and there isn't an open duplicate.
  • I ran pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip and triggered the bug in the latest version.