Skip to content

events.NewMessage event is not triggered for certain channels #4345

@M4jx

Description

@M4jx

Code that causes the issue

@client.on(events.NewMessage(chats = list(channels_hashmap.keys())))
async def main(event):
     print(now.strftime("%d/%m/%Y %H:%M:%S") + f" Received from channel: {event.chat_id}")

Expected behavior

When a new message is sent in a channel passed to chats, the events.NewMessage should be triggered.

Actual behavior

When a new message is sent, the events.NewMessage is not being triggered for certain channels.

I have tested to create a channel in an account A and monitor it in account B (where telethon is running) and the events.NewMessage was triggered instantly. However, for certain public channels that I do not own, the event is not being triggered.

Tested on a newly created channel with 2 subscribers and it worked.
Tested on a public channel with 500K subscribers and it did not work.

Traceback

No crashes are happening.

Telethon version

1.34.0

Python version

3.10.12

Operating system (including distribution name and version)

Ubuntu 22.04.4 LTS

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions