Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent Message Reception Delays and Bursts in Telethon #4399

Closed
3 tasks done
wskxjtzq opened this issue Jun 25, 2024 · 1 comment
Closed
3 tasks done

Intermittent Message Reception Delays and Bursts in Telethon #4399

wskxjtzq opened this issue Jun 25, 2024 · 1 comment

Comments

@wskxjtzq
Copy link

wskxjtzq commented Jun 25, 2024

Code that causes the issue

from telethon import TelegramClient, events
api_id = 77777
api_hash = '777777777777'

phone_number = ""
password = ""

client = TelegramClient('xcoder', api_id, api_hash, system_version="4.16.30-vx_computer") 

@client.on(events.NewMessage)
async def my_event_handler(event):
    sender = await event.get_sender()

    chat_id = event.chat_id
    sender_id = event.sender_id

    print(f"message,from {chat.title} {chat_id} {sender_id}:{event.raw_text}。")


client.start(phone_number, password)
client.run_until_disconnected()

Expected behavior

I am encountering an issue with Telethon while using it to connect to Telegram's API. Previously, a few years ago, the same code worked smoothly, allowing me to receive messages from group chats without any noticeable delays.

Actual behavior

However, when I recently attempted to reconnect using the same code, although messages are still received, their reception seems abnormal. There are long periods (many minutes) where no messages arrive, giving the impression that the messages are stuck, followed suddenly by receiving dozens of messages in a burst.

Traceback

No response

Telethon version

1.36.0

Python version

3.11

Operating system (including distribution name and version)

windows 11

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.
@Lonami
Copy link
Member

Lonami commented Jun 25, 2024

Probably same "bug" as #4345.

@Lonami Lonami closed this as completed Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants