-
-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
enhancementNew feature, request or code enhancement.New feature, request or code enhancement.
Description
Checklist
- I believe the idea is awesome and would benefit the framework
- I have searched in the issue tracker for similar requests, including closed ones
Description
When working with messaging services, it is crucial that listeners have idempotent logic, which ensures that no operations will be duplicated if the service fails and tries to reprocess.
MTProto has a parameter where you can define an ID, which will ensure that the message is sent only once:
random_id long
"Unique client message ID required to prevent message resending"
It exists in the raw functions, but the abstraction that wraps it doesn't have a parameter that we can pass to it:
- https://github.com/hydrogram/hydrogram/blob/dev/hydrogram/methods/messages/send_message.py#L149
- https://github.com/hydrogram/hydrogram/blob/dev/hydrogram/methods/messages/send_photo.py#L192
- https://github.com/hydrogram/hydrogram/blob/dev/hydrogram/methods/messages/send_poll.py#L216
- https://github.com/hydrogram/hydrogram/blob/dev/hydrogram/methods/messages/send_sticker.py#L166
- https://github.com/hydrogram/hydrogram/blob/dev/hydrogram/methods/messages/send_venue.py#L127
- https://github.com/hydrogram/hydrogram/blob/dev/hydrogram/methods/messages/send_video.py#L265
- https://github.com/hydrogram/hydrogram/blob/dev/hydrogram/methods/messages/send_video_note.py#L191
- https://github.com/hydrogram/hydrogram/blob/dev/hydrogram/methods/messages/send_voice.py#L183
Alternatively I am calling the raw function directly.
Metadata
Metadata
Assignees
Labels
enhancementNew feature, request or code enhancement.New feature, request or code enhancement.