mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-19 13:38:50 +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])
|
- `EditedMessageIsTooLong` error ([#109][pr109])
|
||||||
- `UntilDate` enum and use it for `{Restricted, Banned}::until_date` ([#116][pr116])
|
- `UntilDate` enum and use it for `{Restricted, Banned}::until_date` ([#116][pr116])
|
||||||
- `Limits::messages_per_min_channel` ([#121][pr121])
|
- `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
|
[pr109]: https://github.com/teloxide/teloxide-core/pull/109
|
||||||
[pr116]: https://github.com/teloxide/teloxide-core/pull/116
|
[pr116]: https://github.com/teloxide/teloxide-core/pull/116
|
||||||
[pr121]: https://github.com/teloxide/teloxide-core/pull/121
|
[pr121]: https://github.com/teloxide/teloxide-core/pull/121
|
||||||
[pr135]: https://github.com/teloxide/teloxide-core/pull/135
|
[pr135]: https://github.com/teloxide/teloxide-core/pull/135
|
||||||
|
[pr139]: https://github.com/teloxide/teloxide-core/pull/139
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
|
@ -319,6 +319,10 @@ pub struct MediaAudio {
|
||||||
/// bot commands, etc. that appear in the caption.
|
/// bot commands, etc. that appear in the caption.
|
||||||
#[serde(default = "Vec::new")]
|
#[serde(default = "Vec::new")]
|
||||||
pub caption_entities: Vec<MessageEntity>,
|
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)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
@ -340,6 +344,10 @@ pub struct MediaDocument {
|
||||||
/// bot commands, etc. that appear in the caption.
|
/// bot commands, etc. that appear in the caption.
|
||||||
#[serde(default = "Vec::new")]
|
#[serde(default = "Vec::new")]
|
||||||
pub caption_entities: Vec<MessageEntity>,
|
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)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
@ -620,6 +628,14 @@ mod getters {
|
||||||
| Common(MessageCommon {
|
| Common(MessageCommon {
|
||||||
media_kind: MediaKind::Photo(MediaPhoto { media_group_id, .. }),
|
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),
|
}) => media_group_id.as_ref().map(Deref::deref),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue