mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-10 03:52:24 +01:00
Merge pull request #139 from SpriteOvO/master
Add the missing field `media_group_id` to `MediaDocument` & `MediaAudio`
This commit is contained in:
commit
b01655044f
2 changed files with 18 additions and 0 deletions
|
@ -14,11 +14,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- `EditedMessageIsTooLong` error ([#109][pr109])
|
||||
- `UntilDate` enum and use it for `{Restricted, Banned}::until_date` ([#116][pr116])
|
||||
- `Limits::messages_per_min_channel` ([#121][pr121])
|
||||
- `media_group_id` field to `MediaDocument` and `MediaAudio` ([#139][pr139])
|
||||
|
||||
[pr109]: https://github.com/teloxide/teloxide-core/pull/109
|
||||
[pr116]: https://github.com/teloxide/teloxide-core/pull/116
|
||||
[pr121]: https://github.com/teloxide/teloxide-core/pull/121
|
||||
[pr135]: https://github.com/teloxide/teloxide-core/pull/135
|
||||
[pr139]: https://github.com/teloxide/teloxide-core/pull/139
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
@ -319,6 +319,10 @@ pub struct MediaAudio {
|
|||
/// bot commands, etc. that appear in the caption.
|
||||
#[serde(default = "Vec::new")]
|
||||
pub caption_entities: Vec<MessageEntity>,
|
||||
|
||||
/// The unique identifier of a media message group this message belongs
|
||||
/// to.
|
||||
pub media_group_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
|
@ -340,6 +344,10 @@ pub struct MediaDocument {
|
|||
/// bot commands, etc. that appear in the caption.
|
||||
#[serde(default = "Vec::new")]
|
||||
pub caption_entities: Vec<MessageEntity>,
|
||||
|
||||
/// The unique identifier of a media message group this message belongs
|
||||
/// to.
|
||||
pub media_group_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
|
@ -620,6 +628,14 @@ mod getters {
|
|||
| Common(MessageCommon {
|
||||
media_kind: MediaKind::Photo(MediaPhoto { media_group_id, .. }),
|
||||
..
|
||||
})
|
||||
| Common(MessageCommon {
|
||||
media_kind: MediaKind::Document(MediaDocument { media_group_id, .. }),
|
||||
..
|
||||
})
|
||||
| Common(MessageCommon {
|
||||
media_kind: MediaKind::Audio(MediaAudio { media_group_id, .. }),
|
||||
..
|
||||
}) => media_group_id.as_ref().map(Deref::deref),
|
||||
_ => None,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue