Fix docs for uploadStickerFile method

This commit is contained in:
Сырцев Вадим Игоревич 2024-06-06 18:00:18 +03:00
parent 0bbc789caa
commit c24fdf173e
2 changed files with 20 additions and 5 deletions

View file

@ -3575,7 +3575,14 @@ Schema(
Method( Method(
names: ("uploadStickerFile", "UploadStickerFile", "upload_sticker_file"), names: ("uploadStickerFile", "UploadStickerFile", "upload_sticker_file"),
return_ty: RawTy("FileMeta"), return_ty: RawTy("FileMeta"),
doc: Doc(md: "Use this method to upload a .PNG file with a sticker for later use in _createNewStickerSet_ and _addStickerToSet_ methods (can be used multiple times). Returns the uploaded File on success."), doc: Doc(
md: "Use this method to upload a file with a sticker for later use in the [CreateNewStickerSet] and [AddStickerToSet] methods (the file can be used multiple times). Returns the uploaded [File] on success.",
md_links: {
"CreateNewStickerSet": "https://docs.rs/teloxide/latest/teloxide/payloads/struct.CreateNewStickerSet.html",
"AddStickerToSet": "https://docs.rs/teloxide/latest/teloxide/payloads/struct.AddStickerToSet.html",
"File": "https://core.telegram.org/bots/api#file"
}
),
tg_doc: "https://core.telegram.org/bots/api#uploadstickerfile", tg_doc: "https://core.telegram.org/bots/api#uploadstickerfile",
tg_category: "Stickers", tg_category: "Stickers",
params: [ params: [
@ -3588,8 +3595,11 @@ Schema(
name: "sticker", name: "sticker",
ty: RawTy("InputFile"), ty: RawTy("InputFile"),
descr: Doc( descr: Doc(
md: "A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. [More info on Sending Files »]", md: "A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. [Technical requirements]. [More info on Sending Files »]",
md_links: {"More info on Sending Files »": "https://core.telegram.org/bots/api#sending-files"}, md_links: {
"More info on Sending Files »": "https://core.telegram.org/bots/api#sending-files",
"Technical requirements": "https://core.telegram.org/stickers"
},
), ),
), ),
Param( Param(

View file

@ -6,15 +6,20 @@ use crate::types::{FileMeta, InputFile, StickerFormat, UserId};
impl_payload! { impl_payload! {
@[multipart = sticker] @[multipart = sticker]
/// Use this method to upload a .PNG file with a sticker for later use in _createNewStickerSet_ and _addStickerToSet_ methods (can be used multiple times). Returns the uploaded File on success. /// Use this method to upload a file with a sticker for later use in the [CreateNewStickerSet] and [AddStickerToSet] methods (the file can be used multiple times). Returns the uploaded [`File`] on success.
///
/// [CreateNewStickerSet]: https://docs.rs/teloxide/latest/teloxide/payloads/struct.CreateNewStickerSet.html
/// [AddStickerToSet]: https://docs.rs/teloxide/latest/teloxide/payloads/struct.AddStickerToSet.html
/// [`File`]: crate::types::File
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
pub UploadStickerFile (UploadStickerFileSetters) => FileMeta { pub UploadStickerFile (UploadStickerFileSetters) => FileMeta {
required { required {
/// User identifier of sticker file owner /// User identifier of sticker file owner
pub user_id: UserId, pub user_id: UserId,
/// A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. [More info on Sending Files »] /// A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. [Technical requirements]. [More info on Sending Files »]
/// ///
/// [More info on Sending Files »]: crate::types::InputFile /// [More info on Sending Files »]: crate::types::InputFile
/// [Technical requirements]: https://core.telegram.org/stickers
pub sticker: InputFile, pub sticker: InputFile,
/// Format of the sticker, must be one of “static”, “animated”, “video” /// Format of the sticker, must be one of “static”, “animated”, “video”
pub sticker_format: StickerFormat, pub sticker_format: StickerFormat,