-
Notifications
You must be signed in to change notification settings - Fork 2k
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
message_handler: Processes the first two media together when sent simultaneously (type: media_group_id) #2391
Comments
Hi. This behaviour is not due to library but API. The only solution I can offer is implementing a logic yourself.
|
@coder2020official Frankly speaking, receiving gallery is a real pain. I suppose when (if) we have time it may be useful to make some joint handler for media gallery, that will allow to receive gallery itself. I did not make long thinking on it, but it may be useful. |
Yes, I will take a look at this at some point. |
A group can be any file, not just photos. I have media group handling built into my bots and I have never experienced this issue. You cannot just 'catch' a media group at the handler level. Uploads take time and the user might have a slow connection or the files could be big. So if you try and handle them immediately you will split the media group 100% of the time as all uploads are not sent together but instead are sent one at a time as they finish. Even if you did catch the pieces, they then have to be turned into InputMedia objects in order to be sent as a group of something, and keyword arguments like captions, protections, and effects need to be built for the objects as well as keyword arguments for the group itself. And then it needs to be sent as a group. This cannot be done with a handler. It is up to the user to implement this. In addition, there is no way to know if a media group contains 2 things, 6 things, or 10 things. You can't check that. You have to make an assumption. Then there's silly things like certain InputMedia types cannot be grouped together and certain types cannot accept a caption. |
Please answer these questions before submitting your issue. Thanks!
4.22.1
windows
3.11.9
The first two media files are processed together, leading to the same output or action being applied to both.
Code:
Result:
The text was updated successfully, but these errors were encountered: