mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-31 16:40:37 +01:00
Add missing thumbnail_mime_type field to InlineQueryResultGif & InlineQueryResultMpeg4Gif
This commit is contained in:
parent
4d703e2dcf
commit
f883651dbc
2 changed files with 21 additions and 7 deletions
|
@ -21,15 +21,21 @@ pub struct InlineQueryResultGif {
|
||||||
/// Width of the GIF.
|
/// Width of the GIF.
|
||||||
pub gif_width: Option<u32>,
|
pub gif_width: Option<u32>,
|
||||||
|
|
||||||
/// Height of the GIFv.
|
/// Height of the GIF.
|
||||||
pub gif_height: Option<u32>,
|
pub gif_height: Option<u32>,
|
||||||
|
|
||||||
/// Duration of the GIF.
|
/// Duration of the GIF.
|
||||||
pub gif_duration: Option<Seconds>,
|
pub gif_duration: Option<Seconds>,
|
||||||
|
|
||||||
/// URL of the static thumbnail for the result (jpeg or gif).
|
/// URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the
|
||||||
|
/// result
|
||||||
pub thumbnail_url: reqwest::Url,
|
pub thumbnail_url: reqwest::Url,
|
||||||
|
|
||||||
|
// FIXME: maybe make dedicated enum for the mime type?
|
||||||
|
/// MIME type of the thumbnail, must be one of “image/jpeg”,
|
||||||
|
/// “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
|
||||||
|
pub thumbnail_mime_type: Option<String>,
|
||||||
|
|
||||||
/// Title for the result.
|
/// Title for the result.
|
||||||
pub title: Option<String>,
|
pub title: Option<String>,
|
||||||
|
|
||||||
|
@ -58,7 +64,7 @@ pub struct InlineQueryResultGif {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl InlineQueryResultGif {
|
impl InlineQueryResultGif {
|
||||||
pub fn new<S>(id: S, gif_url: reqwest::Url, thumb_url: reqwest::Url) -> Self
|
pub fn new<S>(id: S, gif_url: reqwest::Url, thumbnail_url: reqwest::Url) -> Self
|
||||||
where
|
where
|
||||||
S: Into<String>,
|
S: Into<String>,
|
||||||
{
|
{
|
||||||
|
@ -68,7 +74,8 @@ impl InlineQueryResultGif {
|
||||||
gif_width: None,
|
gif_width: None,
|
||||||
gif_height: None,
|
gif_height: None,
|
||||||
gif_duration: None,
|
gif_duration: None,
|
||||||
thumbnail_url: thumb_url,
|
thumbnail_url,
|
||||||
|
thumbnail_mime_type: None,
|
||||||
title: None,
|
title: None,
|
||||||
caption: None,
|
caption: None,
|
||||||
parse_mode: None,
|
parse_mode: None,
|
||||||
|
|
|
@ -30,9 +30,15 @@ pub struct InlineQueryResultMpeg4Gif {
|
||||||
/// Video duration.
|
/// Video duration.
|
||||||
pub mpeg4_duration: Option<Seconds>,
|
pub mpeg4_duration: Option<Seconds>,
|
||||||
|
|
||||||
/// URL of the static thumbnail (jpeg or gif) for the result.
|
/// URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the
|
||||||
|
/// result
|
||||||
pub thumbnail_url: reqwest::Url,
|
pub thumbnail_url: reqwest::Url,
|
||||||
|
|
||||||
|
// FIXME: maybe make dedicated enum for the mime type?
|
||||||
|
/// MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or
|
||||||
|
/// “video/mp4”. Defaults to “image/jpeg”
|
||||||
|
pub thumbnail_mime_type: Option<String>,
|
||||||
|
|
||||||
/// Title for the result.
|
/// Title for the result.
|
||||||
pub title: Option<String>,
|
pub title: Option<String>,
|
||||||
|
|
||||||
|
@ -61,14 +67,15 @@ pub struct InlineQueryResultMpeg4Gif {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl InlineQueryResultMpeg4Gif {
|
impl InlineQueryResultMpeg4Gif {
|
||||||
pub fn new<S>(id: S, mpeg4_url: reqwest::Url, thumb_url: reqwest::Url) -> Self
|
pub fn new<S>(id: S, mpeg4_url: reqwest::Url, thumbnail_url: reqwest::Url) -> Self
|
||||||
where
|
where
|
||||||
S: Into<String>,
|
S: Into<String>,
|
||||||
{
|
{
|
||||||
Self {
|
Self {
|
||||||
id: id.into(),
|
id: id.into(),
|
||||||
mpeg4_url,
|
mpeg4_url,
|
||||||
thumbnail_url: thumb_url,
|
thumbnail_url,
|
||||||
|
thumbnail_mime_type: None,
|
||||||
mpeg4_width: None,
|
mpeg4_width: None,
|
||||||
mpeg4_height: None,
|
mpeg4_height: None,
|
||||||
mpeg4_duration: None,
|
mpeg4_duration: None,
|
||||||
|
|
Loading…
Reference in a new issue