mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Rename "thumb" to "thumbnail" in methods
This commit is contained in:
parent
c1ec37eb0a
commit
a6ae13c72b
7 changed files with 18 additions and 16 deletions
|
@ -574,7 +574,7 @@ Schema(
|
|||
descr: Doc(md: "Track name"),
|
||||
),
|
||||
Param(
|
||||
name: "thumb",
|
||||
name: "thumbnail",
|
||||
ty: Option(RawTy("InputFile")),
|
||||
descr: Doc(
|
||||
md: "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]",
|
||||
|
@ -646,7 +646,7 @@ Schema(
|
|||
),
|
||||
),
|
||||
Param(
|
||||
name: "thumb",
|
||||
name: "thumbnail",
|
||||
ty: Option(RawTy("InputFile")),
|
||||
descr: Doc(
|
||||
md: "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]",
|
||||
|
@ -759,7 +759,7 @@ Schema(
|
|||
descr: Doc(md: "Video height"),
|
||||
),
|
||||
Param(
|
||||
name: "thumb",
|
||||
name: "thumbnail",
|
||||
ty: Option(RawTy("InputFile")),
|
||||
descr: Doc(
|
||||
md: "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]",
|
||||
|
@ -875,7 +875,7 @@ Schema(
|
|||
descr: Doc(md: "Animation height"),
|
||||
),
|
||||
Param(
|
||||
name: "thumb",
|
||||
name: "thumbnail",
|
||||
ty: Option(RawTy("InputFile")),
|
||||
descr: Doc(
|
||||
md: "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]",
|
||||
|
@ -1069,7 +1069,7 @@ Schema(
|
|||
descr: Doc(md: "Video width and height, i.e. diameter of the video message"),
|
||||
),
|
||||
Param(
|
||||
name: "thumb",
|
||||
name: "thumbnail",
|
||||
ty: Option(RawTy("InputFile")),
|
||||
descr: Doc(
|
||||
md: "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]",
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::types::{
|
|||
};
|
||||
|
||||
impl_payload! {
|
||||
@[multipart = animation, thumb]
|
||||
@[multipart = animation, thumbnail]
|
||||
/// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent [`Message`] is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
|
||||
///
|
||||
/// [`Message`]: crate::types::Message
|
||||
|
@ -33,7 +33,7 @@ impl_payload! {
|
|||
/// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]
|
||||
///
|
||||
/// [More info on Sending Files »]: crate::types::InputFile
|
||||
pub thumb: InputFile,
|
||||
pub thumbnail: InputFile,
|
||||
/// Animation caption (may also be used when resending videos by _file\_id_), 0-1024 characters after entities parsing
|
||||
pub caption: String [into],
|
||||
/// Mode for parsing entities in the animation caption. See [formatting options] for more details.
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::types::{
|
|||
};
|
||||
|
||||
impl_payload! {
|
||||
@[multipart = audio, thumb]
|
||||
@[multipart = audio, thumbnail]
|
||||
/// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent [`Message`] is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
|
||||
///
|
||||
/// For sending voice messages, use the [`SendVoice`] method instead.
|
||||
|
@ -44,7 +44,7 @@ impl_payload! {
|
|||
/// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]
|
||||
///
|
||||
/// [More info on Sending Files »]: crate::types::InputFile
|
||||
pub thumb: InputFile,
|
||||
pub thumbnail: InputFile,
|
||||
/// Sends the message [silently]. Users will receive a notification with no sound.
|
||||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::types::{
|
|||
};
|
||||
|
||||
impl_payload! {
|
||||
@[multipart = document, thumb]
|
||||
@[multipart = document, thumbnail]
|
||||
/// Use this method to send general files. On success, the sent [`Message`] is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
|
||||
///
|
||||
/// [`Message`]: crate::types::Message
|
||||
|
@ -27,7 +27,7 @@ impl_payload! {
|
|||
/// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]
|
||||
///
|
||||
/// [More info on Sending Files »]: crate::types::InputFile
|
||||
pub thumb: InputFile,
|
||||
pub thumbnail: InputFile,
|
||||
/// Document caption (may also be used when resending documents by _file\_id_), 0-1024 characters after entities parsing
|
||||
pub caption: String [into],
|
||||
/// Mode for parsing entities in the audio caption. See [formatting options] for more details.
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::types::{
|
|||
};
|
||||
|
||||
impl_payload! {
|
||||
@[multipart = video, thumb]
|
||||
@[multipart = video, thumbnail]
|
||||
/// Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as [`Document`]). On success, the sent [`Message`] is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
|
||||
///
|
||||
/// [`Document`]: crate::types::Document
|
||||
|
@ -34,7 +34,7 @@ impl_payload! {
|
|||
/// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]
|
||||
///
|
||||
/// [More info on Sending Files »]: crate::types::InputFile
|
||||
pub thumb: InputFile,
|
||||
pub thumbnail: InputFile,
|
||||
/// Video caption (may also be used when resending videos by _file\_id_), 0-1024 characters after entities parsing
|
||||
pub caption: String [into],
|
||||
/// Mode for parsing entities in the video caption. See [formatting options] for more details.
|
||||
|
|
|
@ -5,7 +5,7 @@ use serde::Serialize;
|
|||
use crate::types::{InputFile, Message, MessageId, Recipient, ReplyMarkup, ThreadId};
|
||||
|
||||
impl_payload! {
|
||||
@[multipart = video_note, thumb]
|
||||
@[multipart = video_note, thumbnail]
|
||||
/// As of [v.4.0], Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent [`Message`] is returned.
|
||||
///
|
||||
/// [v.4.0]: https://core.telegram.org/bots/api#document
|
||||
|
@ -30,7 +30,7 @@ impl_payload! {
|
|||
/// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]
|
||||
///
|
||||
/// [More info on Sending Files »]: crate::types::InputFile
|
||||
pub thumb: InputFile,
|
||||
pub thumbnail: InputFile,
|
||||
/// Sends the message [silently]. Users will receive a notification with no sound.
|
||||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
|
|
|
@ -173,7 +173,9 @@ mod tests {
|
|||
InputFile::file("../../media/teloxide-core-logo.png"),
|
||||
)
|
||||
.caption_entities(entities())
|
||||
.thumb(InputFile::read(File::open("../../media/teloxide-core-logo.png").await.unwrap()))
|
||||
.thumbnail(InputFile::read(
|
||||
File::open("../../media/teloxide-core-logo.png").await.unwrap(),
|
||||
))
|
||||
.allow_sending_without_reply(true),
|
||||
)
|
||||
.unwrap()
|
||||
|
|
Loading…
Reference in a new issue