From bfd5fa385205ee31749c3fa5ee92ad8bebf7335a Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Sun, 5 Jan 2025 12:21:02 +0200 Subject: [PATCH] Bot API 8.2 --- src/api_params.rs | 27 +++++++++++++++++++++++++++ src/objects.rs | 6 ++++++ src/trait_async.rs | 12 +++++++++--- src/trait_sync.rs | 12 +++++++++--- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/src/api_params.rs b/src/api_params.rs index ce581d6..c8f2b1a 100644 --- a/src/api_params.rs +++ b/src/api_params.rs @@ -1235,11 +1235,38 @@ pub struct DeleteStickerSetParams { pub struct SendGiftParams { pub user_id: u64, pub gift_id: String, + pub pay_for_upgrade: Option, pub text: Option, pub text_parse_mode: Option, pub text_entities: Option>, } +#[apply(apistruct!)] +#[derive(Eq)] +pub struct VerifyUserParams { + pub user_id: u64, + pub custom_description: Option, +} + +#[apply(apistruct!)] +#[derive(Eq)] +pub struct VerifyChatParams { + pub chat_id: ChatId, + pub custom_description: Option, +} + +#[apply(apistruct!)] +#[derive(Eq)] +pub struct RemoveUserVerificationParams { + pub user_id: u64, +} + +#[apply(apistruct!)] +#[derive(Eq)] +pub struct RemoveChatVerificationParams { + pub chat_id: ChatId, +} + #[apply(apistruct!)] pub struct AnswerInlineQueryParams { pub inline_query_id: String, diff --git a/src/objects.rs b/src/objects.rs index abd08ee..393fde4 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -1345,6 +1345,7 @@ pub struct Gift { pub id: String, pub stricker: Sticker, pub star_count: u32, + pub upgrade_star_count: Option, pub total_count: Option, pub remaining_count: Option, } @@ -1398,6 +1399,11 @@ pub struct InlineQueryResultArticle { pub input_message_content: InputMessageContent, pub reply_markup: Option, pub url: Option, + #[doc(hidden)] + #[deprecated( + since = "0.38.0", + note = "Please pass an empty string as `url` instead" + )] pub hide_url: Option, pub description: Option, pub thumbnail_url: Option, diff --git a/src/trait_async.rs b/src/trait_async.rs index 7a819b1..f007c4f 100644 --- a/src/trait_async.rs +++ b/src/trait_async.rs @@ -2,9 +2,11 @@ use std::path::PathBuf; use crate::api_params::{ AddStickerToSetParams, CreateNewStickerSetParams, EditMessageMediaParams, FileUpload, - InputMedia, Media, SendAnimationParams, SendAudioParams, SendDocumentParams, - SendMediaGroupParams, SendPhotoParams, SendStickerParams, SendVideoNoteParams, SendVideoParams, - SendVoiceParams, SetChatPhotoParams, SetStickerSetThumbnailParams, UploadStickerFileParams, + InputMedia, Media, RemoveChatVerificationParams, RemoveUserVerificationParams, + SendAnimationParams, SendAudioParams, SendDocumentParams, SendMediaGroupParams, + SendPhotoParams, SendStickerParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, + SetChatPhotoParams, SetStickerSetThumbnailParams, UploadStickerFileParams, VerifyChatParams, + VerifyUserParams, }; use crate::objects::{ BotCommand, BotDescription, BotName, BotShortDescription, BusinessConnection, @@ -628,6 +630,10 @@ where request!(deleteStickerSet, bool); request_nb!(getAvailableGifts, Gifts); request!(sendGift, bool); + request!(verifyUser, bool); + request!(verifyChat, bool); + request!(removeUserVerification, bool); + request!(removeChatVerification, bool); request!(sendInvoice, Message); request!(createInvoiceLink, String); request!(answerShippingQuery, bool); diff --git a/src/trait_sync.rs b/src/trait_sync.rs index 28e33f2..3b40077 100644 --- a/src/trait_sync.rs +++ b/src/trait_sync.rs @@ -2,9 +2,11 @@ use std::path::PathBuf; use crate::api_params::{ AddStickerToSetParams, CreateNewStickerSetParams, EditMessageMediaParams, FileUpload, - InputMedia, Media, SendAnimationParams, SendAudioParams, SendDocumentParams, - SendMediaGroupParams, SendPhotoParams, SendStickerParams, SendVideoNoteParams, SendVideoParams, - SendVoiceParams, SetChatPhotoParams, SetStickerSetThumbnailParams, UploadStickerFileParams, + InputMedia, Media, RemoveChatVerificationParams, RemoveUserVerificationParams, + SendAnimationParams, SendAudioParams, SendDocumentParams, SendMediaGroupParams, + SendPhotoParams, SendStickerParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, + SetChatPhotoParams, SetStickerSetThumbnailParams, UploadStickerFileParams, VerifyChatParams, + VerifyUserParams, }; use crate::objects::{ BotCommand, BotDescription, BotName, BotShortDescription, BusinessConnection, @@ -594,6 +596,10 @@ pub trait TelegramApi { request!(deleteStickerSet, bool); request_nb!(getAvailableGifts, Gifts); request!(sendGift, bool); + request!(verifyUser, bool); + request!(verifyChat, bool); + request!(removeUserVerification, bool); + request!(removeChatVerification, bool); request!(sendInvoice, Message); request!(createInvoiceLink, String); request!(answerShippingQuery, bool);