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

The same album event process twice if there are two Album handlers #4279

Open
3 tasks done
V-ampire opened this issue Dec 21, 2023 · 2 comments
Open
3 tasks done

The same album event process twice if there are two Album handlers #4279

V-ampire opened this issue Dec 21, 2023 · 2 comments

Comments

@V-ampire
Copy link

Code that causes the issue

@client.on(events.Album)
def first(e):
print(f"album events FIRST {event=}")

@client.on(events.Album)
def second(e):
print(f"album events SECOND {event=}")

Expected behavior

Process album once per handler.

Actual behavior

When I have only first handler it is ok:
$ album events FIRST event=<telethon.events.album.Album.Event object at 0x7f8b14d606d0>

but if I add the second first handler calls twice

$ album events FIRST event=<telethon.events.album.Album.Event object at 0x7fe79c6b4130>
$ album events SECOND event=<telethon.events.album.Album.Event object at 0x7fe79c6b4130>
$ album events FIRST event=<telethon.events.album.Album.Event object at 0x7fe79c6b4130>

Traceback

No response

Telethon version

1.33.1

Python version

3.10

Operating system (including distribution name and version)

Ubuntu 20.04

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 Dec 22, 2023

Unlikely to be fixed in v1. Album handling is a hack. Recommendation is to use a single handler.

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

3 participants
@Lonami @V-ampire and others