diff --git a/src/adaptors/auto_send.rs b/src/adaptors/auto_send.rs index 54a85d87..890979ac 100644 --- a/src/adaptors/auto_send.rs +++ b/src/adaptors/auto_send.rs @@ -78,21 +78,27 @@ impl Requester for AutoSend { type Err = B::Err; requester_forward! { - get_me, send_message, get_updates, set_webhook, delete_webhook, get_webhook_info, - forward_message, send_photo, send_audio, send_document, send_video, - send_animation, send_voice, send_video_note, send_media_group, send_location, - edit_message_live_location, edit_message_live_location_inline, stop_message_live_location, - stop_message_live_location_inline, send_venue, send_contact, send_poll, send_dice, - send_chat_action, get_user_profile_photos, get_file, kick_chat_member, unban_chat_member, - restrict_chat_member, promote_chat_member, set_chat_administrator_custom_title, set_chat_permissions, - export_chat_invite_link, set_chat_photo, delete_chat_photo, set_chat_title, set_chat_description, - pin_chat_message, unpin_chat_message, leave_chat, get_chat, get_chat_administrators, get_chat_members_count, - get_chat_member, set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query, set_my_commands, - get_my_commands, answer_inline_query, edit_message_text, edit_message_text_inline, edit_message_caption, - edit_message_caption_inline, edit_message_media, edit_message_media_inline, edit_message_reply_markup, - edit_message_reply_markup_inline, stop_poll, delete_message, send_sticker, get_sticker_set, upload_sticker_file, - create_new_sticker_set, add_sticker_to_set, set_sticker_position_in_set, delete_sticker_from_set, - set_sticker_set_thumb, send_invoice, answer_shipping_query, answer_pre_checkout_query, set_passport_data_errors => f, fty + get_me, send_message, get_updates, set_webhook, delete_webhook, + get_webhook_info, forward_message, send_photo, send_audio, send_document, + send_video, send_animation, send_voice, send_video_note, send_media_group, + send_location, edit_message_live_location, edit_message_live_location_inline, + stop_message_live_location, stop_message_live_location_inline, send_venue, + send_contact, send_poll, send_dice, send_chat_action, get_user_profile_photos, + get_file, kick_chat_member, unban_chat_member, restrict_chat_member, + promote_chat_member, set_chat_administrator_custom_title, set_chat_permissions, + export_chat_invite_link, set_chat_photo, delete_chat_photo, set_chat_title, + set_chat_description, pin_chat_message, unpin_chat_message, leave_chat, + get_chat, get_chat_administrators, get_chat_members_count, get_chat_member, + set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query, + set_my_commands, get_my_commands, answer_inline_query, edit_message_text, + edit_message_text_inline, edit_message_caption, edit_message_caption_inline, + edit_message_media, edit_message_media_inline, edit_message_reply_markup, + edit_message_reply_markup_inline, stop_poll, delete_message, send_sticker, + get_sticker_set, upload_sticker_file, create_new_sticker_set, + add_sticker_to_set, set_sticker_position_in_set, delete_sticker_from_set, + set_sticker_set_thumb, send_invoice, answer_shipping_query, + answer_pre_checkout_query, set_passport_data_errors, send_game, + set_game_score, set_game_score_inline, get_game_high_scores => f, fty } } diff --git a/src/adaptors/cache_me.rs b/src/adaptors/cache_me.rs index 8f54a2ee..2a23a2ae 100644 --- a/src/adaptors/cache_me.rs +++ b/src/adaptors/cache_me.rs @@ -98,18 +98,24 @@ where get_updates, set_webhook, delete_webhook, get_webhook_info, forward_message, send_photo, send_audio, send_document, send_video, send_animation, send_voice, send_video_note, send_media_group, send_location, - edit_message_live_location, edit_message_live_location_inline, stop_message_live_location, - stop_message_live_location_inline, send_venue, send_contact, send_poll, send_dice, - send_chat_action, get_user_profile_photos, get_file, kick_chat_member, unban_chat_member, - restrict_chat_member, promote_chat_member, set_chat_administrator_custom_title, set_chat_permissions, - export_chat_invite_link, set_chat_photo, delete_chat_photo, set_chat_title, set_chat_description, - pin_chat_message, unpin_chat_message, leave_chat, get_chat, get_chat_administrators, get_chat_members_count, - get_chat_member, set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query, set_my_commands, - get_my_commands, answer_inline_query, edit_message_text, edit_message_text_inline, edit_message_caption, - edit_message_caption_inline, edit_message_media, edit_message_media_inline, edit_message_reply_markup, - edit_message_reply_markup_inline, stop_poll, delete_message, send_sticker, get_sticker_set, upload_sticker_file, - create_new_sticker_set, add_sticker_to_set, set_sticker_position_in_set, delete_sticker_from_set, - set_sticker_set_thumb, send_invoice, answer_shipping_query, answer_pre_checkout_query, set_passport_data_errors => f, fty + edit_message_live_location, edit_message_live_location_inline, + stop_message_live_location, stop_message_live_location_inline, send_venue, + send_contact, send_poll, send_dice, send_chat_action, get_user_profile_photos, + get_file, kick_chat_member, unban_chat_member, restrict_chat_member, + promote_chat_member, set_chat_administrator_custom_title, set_chat_permissions, + export_chat_invite_link, set_chat_photo, delete_chat_photo, set_chat_title, + set_chat_description, pin_chat_message, unpin_chat_message, leave_chat, + get_chat, get_chat_administrators, get_chat_members_count,get_chat_member, + set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query, + set_my_commands, get_my_commands, answer_inline_query, edit_message_text, + edit_message_text_inline, edit_message_caption, edit_message_caption_inline, + edit_message_media, edit_message_media_inline, edit_message_reply_markup, + edit_message_reply_markup_inline, stop_poll, delete_message, send_sticker, + get_sticker_set, upload_sticker_file, create_new_sticker_set, + add_sticker_to_set, set_sticker_position_in_set, delete_sticker_from_set, + set_sticker_set_thumb, send_invoice, answer_shipping_query, + answer_pre_checkout_query, set_passport_data_errors, send_game, + set_game_score, set_game_score_inline, get_game_high_scores => f, fty } } diff --git a/src/adaptors/parse_mode.rs b/src/adaptors/parse_mode.rs index 5057a5f1..df7a612b 100644 --- a/src/adaptors/parse_mode.rs +++ b/src/adaptors/parse_mode.rs @@ -93,17 +93,23 @@ impl Requester for DefaultParseMode { requester_forward! { get_me, get_updates, set_webhook, delete_webhook, get_webhook_info, forward_message, send_video_note, send_media_group, send_location, - edit_message_live_location, edit_message_live_location_inline, stop_message_live_location, - stop_message_live_location_inline, send_venue, send_contact, send_dice, - send_chat_action, get_user_profile_photos, get_file, kick_chat_member, unban_chat_member, - restrict_chat_member, promote_chat_member, set_chat_administrator_custom_title, set_chat_permissions, - export_chat_invite_link, set_chat_photo, delete_chat_photo, set_chat_title, set_chat_description, - pin_chat_message, unpin_chat_message, leave_chat, get_chat, get_chat_administrators, get_chat_members_count, - get_chat_member, set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query, set_my_commands, - get_my_commands, answer_inline_query, edit_message_media, edit_message_media_inline, edit_message_reply_markup, - edit_message_reply_markup_inline, stop_poll, delete_message, send_sticker, get_sticker_set, upload_sticker_file, - create_new_sticker_set, add_sticker_to_set, set_sticker_position_in_set, delete_sticker_from_set, - set_sticker_set_thumb, send_invoice, answer_shipping_query, answer_pre_checkout_query, set_passport_data_errors => fid, fty + edit_message_live_location, edit_message_live_location_inline, + stop_message_live_location, stop_message_live_location_inline, send_venue, + send_contact, send_dice, send_chat_action, get_user_profile_photos, + get_file, kick_chat_member, unban_chat_member, restrict_chat_member, + promote_chat_member, set_chat_administrator_custom_title, set_chat_permissions, + export_chat_invite_link, set_chat_photo, delete_chat_photo, set_chat_title, + set_chat_description, pin_chat_message, unpin_chat_message, leave_chat, + get_chat, get_chat_administrators, get_chat_members_count, get_chat_member, + set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query, + set_my_commands, get_my_commands, answer_inline_query, edit_message_media, + edit_message_media_inline, edit_message_reply_markup, + edit_message_reply_markup_inline, stop_poll, delete_message, + send_sticker, get_sticker_set, upload_sticker_file, create_new_sticker_set, + add_sticker_to_set, set_sticker_position_in_set, delete_sticker_from_set, + set_sticker_set_thumb, send_invoice, answer_shipping_query, + answer_pre_checkout_query, set_passport_data_errors, send_game, set_game_score, + set_game_score_inline, get_game_high_scores => fid, fty } } diff --git a/src/adaptors/throttle.rs b/src/adaptors/throttle.rs index e7e2250c..db26038f 100644 --- a/src/adaptors/throttle.rs +++ b/src/adaptors/throttle.rs @@ -443,17 +443,25 @@ where } requester_forward! { - get_me, get_updates, set_webhook, delete_webhook, get_webhook_info, edit_message_live_location, edit_message_live_location_inline, stop_message_live_location, - stop_message_live_location_inline, send_chat_action, get_user_profile_photos, get_file, kick_chat_member, unban_chat_member, - restrict_chat_member, promote_chat_member, set_chat_administrator_custom_title, set_chat_permissions, - export_chat_invite_link, set_chat_photo, delete_chat_photo, set_chat_title, set_chat_description, - pin_chat_message, unpin_chat_message, leave_chat, get_chat, get_chat_administrators, get_chat_members_count, - get_chat_member, set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query, set_my_commands, - get_my_commands, answer_inline_query, edit_message_text, edit_message_text_inline, edit_message_caption, - edit_message_caption_inline, edit_message_media, edit_message_media_inline, edit_message_reply_markup, - edit_message_reply_markup_inline, stop_poll, delete_message, get_sticker_set, upload_sticker_file, - create_new_sticker_set, add_sticker_to_set, set_sticker_position_in_set, delete_sticker_from_set, - set_sticker_set_thumb, answer_shipping_query, answer_pre_checkout_query, set_passport_data_errors => fid, ftyid + get_me, get_updates, set_webhook, delete_webhook, get_webhook_info, + edit_message_live_location, edit_message_live_location_inline, + stop_message_live_location, stop_message_live_location_inline, + send_chat_action, get_user_profile_photos, get_file, kick_chat_member, + unban_chat_member, restrict_chat_member, promote_chat_member, + set_chat_administrator_custom_title, set_chat_permissions, + export_chat_invite_link, set_chat_photo, delete_chat_photo, set_chat_title, + set_chat_description, pin_chat_message, unpin_chat_message, leave_chat, + get_chat, get_chat_administrators, get_chat_members_count, + get_chat_member, set_chat_sticker_set, delete_chat_sticker_set, + answer_callback_query, set_my_commands, get_my_commands, answer_inline_query, + edit_message_text, edit_message_text_inline, edit_message_caption, + edit_message_caption_inline, edit_message_media, edit_message_media_inline, + edit_message_reply_markup, edit_message_reply_markup_inline, stop_poll, + delete_message, get_sticker_set, upload_sticker_file, create_new_sticker_set, + add_sticker_to_set, set_sticker_position_in_set, delete_sticker_from_set, + set_sticker_set_thumb, answer_shipping_query, answer_pre_checkout_query, + set_passport_data_errors, send_game, set_game_score, set_game_score_inline, + get_game_high_scores => fid, ftyid } } diff --git a/src/bot/api.rs b/src/bot/api.rs index 560efd01..01463afa 100644 --- a/src/bot/api.rs +++ b/src/bot/api.rs @@ -76,78 +76,56 @@ impl Requester for Bot { type SendPhoto = MultipartRequest; - fn send_photo(&self, chat_id: Ch, photo: InputFile, caption: Ca) -> Self::SendPhoto + fn send_photo(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto where - Ch: Into, - Ca: Into, + C: Into, { - Self::SendPhoto::new(self.clone(), payloads::SendPhoto::new(chat_id, photo, caption)) + Self::SendPhoto::new(self.clone(), payloads::SendPhoto::new(chat_id, photo)) } type SendAudio = MultipartRequest; - fn send_audio(&self, chat_id: Ch, audio: InputFile, caption: Ca) -> Self::SendAudio + fn send_audio(&self, chat_id: C, audio: InputFile) -> Self::SendAudio where - Ch: Into, - Ca: Into, + C: Into, { - Self::SendAudio::new(self.clone(), payloads::SendAudio::new(chat_id, audio, caption)) + Self::SendAudio::new(self.clone(), payloads::SendAudio::new(chat_id, audio)) } type SendDocument = MultipartRequest; - fn send_document( - &self, - chat_id: Ch, - document: InputFile, - caption: Ca, - ) -> Self::SendDocument + fn send_document(&self, chat_id: C, document: InputFile) -> Self::SendDocument where - Ch: Into, - Ca: Into, + C: Into, { - Self::SendDocument::new( - self.clone(), - payloads::SendDocument::new(chat_id, document, caption), - ) + Self::SendDocument::new(self.clone(), payloads::SendDocument::new(chat_id, document)) } type SendVideo = MultipartRequest; - fn send_video(&self, chat_id: Ch, video: InputFile, caption: Ca) -> Self::SendVideo + fn send_video(&self, chat_id: C, video: InputFile) -> Self::SendVideo where - Ch: Into, - Ca: Into, + C: Into, { - Self::SendVideo::new(self.clone(), payloads::SendVideo::new(chat_id, video, caption)) + Self::SendVideo::new(self.clone(), payloads::SendVideo::new(chat_id, video)) } type SendAnimation = MultipartRequest; - fn send_animation( - &self, - chat_id: Ch, - animation: InputFile, - caption: Ca, - ) -> Self::SendAnimation + fn send_animation(&self, chat_id: C, animation: InputFile) -> Self::SendAnimation where - Ch: Into, - Ca: Into, + C: Into, { - Self::SendAnimation::new( - self.clone(), - payloads::SendAnimation::new(chat_id, animation, caption), - ) + Self::SendAnimation::new(self.clone(), payloads::SendAnimation::new(chat_id, animation)) } type SendVoice = MultipartRequest; - fn send_voice(&self, chat_id: Ch, voice: InputFile, caption: Ca) -> Self::SendVoice + fn send_voice(&self, chat_id: C, voice: InputFile) -> Self::SendVoice where - Ch: Into, - Ca: Into, + C: Into, { - Self::SendVoice::new(self.clone(), payloads::SendVoice::new(chat_id, voice, caption)) + Self::SendVoice::new(self.clone(), payloads::SendVoice::new(chat_id, voice)) } type SendVideoNote = MultipartRequest; @@ -634,36 +612,25 @@ impl Requester for Bot { type EditMessageCaption = JsonRequest; - fn edit_message_caption( - &self, - chat_id: Ch, - message_id: i32, - caption: Ca, - ) -> Self::EditMessageCaption + fn edit_message_caption(&self, chat_id: C, message_id: i32) -> Self::EditMessageCaption where - Ch: Into, - Ca: Into, + C: Into, { Self::EditMessageCaption::new( self.clone(), - payloads::EditMessageCaption::new(chat_id, message_id, caption), + payloads::EditMessageCaption::new(chat_id, message_id), ) } type EditMessageCaptionInline = JsonRequest; - fn edit_message_caption_inline( - &self, - inline_message_id: I, - caption: C, - ) -> Self::EditMessageCaptionInline + fn edit_message_caption_inline(&self, inline_message_id: I) -> Self::EditMessageCaptionInline where I: Into, - C: Into, { Self::EditMessageCaptionInline::new( self.clone(), - payloads::EditMessageCaptionInline::new(inline_message_id, caption), + payloads::EditMessageCaptionInline::new(inline_message_id), ) } @@ -929,4 +896,57 @@ impl Requester for Bot { payloads::SetPassportDataErrors::new(user_id, errors), ) } + + type SendGame = JsonRequest; + + fn send_game(&self, chat_id: u32, game_short_name: G) -> Self::SendGame + where + G: Into, + { + Self::SendGame::new(self.clone(), payloads::SendGame::new(chat_id, game_short_name)) + } + + type SetGameScore = JsonRequest; + + fn set_game_score( + &self, + user_id: u32, + score: u64, + chat_id: u32, + message_id: i64, + ) -> Self::SetGameScore { + Self::SetGameScore::new( + self.clone(), + payloads::SetGameScore::new(user_id, score, chat_id, message_id), + ) + } + + type SetGameScoreInline = JsonRequest; + + fn set_game_score_inline( + &self, + user_id: u32, + score: u64, + inline_message_id: I, + ) -> Self::SetGameScoreInline + where + I: Into, + { + Self::SetGameScoreInline::new( + self.clone(), + payloads::SetGameScoreInline::new(user_id, score, inline_message_id), + ) + } + + type GetGameHighScores = JsonRequest; + + fn get_game_high_scores(&self, user_id: u32, target: T) -> Self::GetGameHighScores + where + T: Into, + { + Self::GetGameHighScores::new( + self.clone(), + payloads::GetGameHighScores::new(user_id, target), + ) + } } diff --git a/src/local_macros.rs b/src/local_macros.rs index 146fedd3..25cffd7f 100644 --- a/src/local_macros.rs +++ b/src/local_macros.rs @@ -373,7 +373,7 @@ macro_rules! impl_payload { } #[macro_use] -// This macro is auto generated by `cg` (a8fa55a). +// This macro is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS MACRO**, // edit `cg` instead. macro_rules! requester_forward { @@ -447,55 +447,49 @@ macro_rules! requester_forward { (@method send_photo $body:ident $ty:ident) => { type SendPhoto = $ty![SendPhoto]; - fn send_photo(&self, chat_id: Ch, photo: InputFile, caption: Ca) -> Self::SendPhoto where Ch: Into, - Ca: Into { + fn send_photo(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto where C: Into { let this = self; - $body!(send_photo this (chat_id: Ch, photo: InputFile, caption: Ca)) + $body!(send_photo this (chat_id: C, photo: InputFile)) } }; (@method send_audio $body:ident $ty:ident) => { type SendAudio = $ty![SendAudio]; - fn send_audio(&self, chat_id: Ch, audio: InputFile, caption: Ca) -> Self::SendAudio where Ch: Into, - Ca: Into { + fn send_audio(&self, chat_id: C, audio: InputFile) -> Self::SendAudio where C: Into { let this = self; - $body!(send_audio this (chat_id: Ch, audio: InputFile, caption: Ca)) + $body!(send_audio this (chat_id: C, audio: InputFile)) } }; (@method send_document $body:ident $ty:ident) => { type SendDocument = $ty![SendDocument]; - fn send_document(&self, chat_id: Ch, document: InputFile, caption: Ca) -> Self::SendDocument where Ch: Into, - Ca: Into { + fn send_document(&self, chat_id: C, document: InputFile) -> Self::SendDocument where C: Into { let this = self; - $body!(send_document this (chat_id: Ch, document: InputFile, caption: Ca)) + $body!(send_document this (chat_id: C, document: InputFile)) } }; (@method send_video $body:ident $ty:ident) => { type SendVideo = $ty![SendVideo]; - fn send_video(&self, chat_id: Ch, video: InputFile, caption: Ca) -> Self::SendVideo where Ch: Into, - Ca: Into { + fn send_video(&self, chat_id: C, video: InputFile) -> Self::SendVideo where C: Into { let this = self; - $body!(send_video this (chat_id: Ch, video: InputFile, caption: Ca)) + $body!(send_video this (chat_id: C, video: InputFile)) } }; (@method send_animation $body:ident $ty:ident) => { type SendAnimation = $ty![SendAnimation]; - fn send_animation(&self, chat_id: Ch, animation: InputFile, caption: Ca) -> Self::SendAnimation where Ch: Into, - Ca: Into { + fn send_animation(&self, chat_id: C, animation: InputFile) -> Self::SendAnimation where C: Into { let this = self; - $body!(send_animation this (chat_id: Ch, animation: InputFile, caption: Ca)) + $body!(send_animation this (chat_id: C, animation: InputFile)) } }; (@method send_voice $body:ident $ty:ident) => { type SendVoice = $ty![SendVoice]; - fn send_voice(&self, chat_id: Ch, voice: InputFile, caption: Ca) -> Self::SendVoice where Ch: Into, - Ca: Into { + fn send_voice(&self, chat_id: C, voice: InputFile) -> Self::SendVoice where C: Into { let this = self; - $body!(send_voice this (chat_id: Ch, voice: InputFile, caption: Ca)) + $body!(send_voice this (chat_id: C, voice: InputFile)) } }; (@method send_video_note $body:ident $ty:ident) => { @@ -832,19 +826,17 @@ macro_rules! requester_forward { (@method edit_message_caption $body:ident $ty:ident) => { type EditMessageCaption = $ty![EditMessageCaption]; - fn edit_message_caption(&self, chat_id: Ch, message_id: i32, caption: Ca) -> Self::EditMessageCaption where Ch: Into, - Ca: Into { + fn edit_message_caption(&self, chat_id: C, message_id: i32) -> Self::EditMessageCaption where C: Into { let this = self; - $body!(edit_message_caption this (chat_id: Ch, message_id: i32, caption: Ca)) + $body!(edit_message_caption this (chat_id: C, message_id: i32)) } }; (@method edit_message_caption_inline $body:ident $ty:ident) => { type EditMessageCaptionInline = $ty![EditMessageCaptionInline]; - fn edit_message_caption_inline(&self, inline_message_id: I, caption: C) -> Self::EditMessageCaptionInline where I: Into, - C: Into { + fn edit_message_caption_inline(&self, inline_message_id: I) -> Self::EditMessageCaptionInline where I: Into { let this = self; - $body!(edit_message_caption_inline this (inline_message_id: I, caption: C)) + $body!(edit_message_caption_inline this (inline_message_id: I)) } }; (@method edit_message_media $body:ident $ty:ident) => { @@ -1000,6 +992,38 @@ macro_rules! requester_forward { $body!(set_passport_data_errors this (user_id: i32, errors: E)) } }; + (@method send_game $body:ident $ty:ident) => { + type SendGame = $ty![SendGame]; + + fn send_game(&self, chat_id: u32, game_short_name: G) -> Self::SendGame where G: Into { + let this = self; + $body!(send_game this (chat_id: u32, game_short_name: G)) + } + }; + (@method set_game_score $body:ident $ty:ident) => { + type SetGameScore = $ty![SetGameScore]; + + fn set_game_score(&self, user_id: u32, score: u64, chat_id: u32, message_id: i64) -> Self::SetGameScore { + let this = self; + $body!(set_game_score this (user_id: u32, score: u64, chat_id: u32, message_id: i64)) + } + }; + (@method set_game_score_inline $body:ident $ty:ident) => { + type SetGameScoreInline = $ty![SetGameScoreInline]; + + fn set_game_score_inline(&self, user_id: u32, score: u64, inline_message_id: I) -> Self::SetGameScoreInline where I: Into { + let this = self; + $body!(set_game_score_inline this (user_id: u32, score: u64, inline_message_id: I)) + } + }; + (@method get_game_high_scores $body:ident $ty:ident) => { + type GetGameHighScores = $ty![GetGameHighScores]; + + fn get_game_high_scores(&self, user_id: u32, target: T) -> Self::GetGameHighScores where T: Into { + let this = self; + $body!(get_game_high_scores this (user_id: u32, target: T)) + } + }; } #[macro_use] diff --git a/src/payloads/add_sticker_to_set.rs b/src/payloads/add_sticker_to_set.rs index 7836bd43..1a24bf81 100644 --- a/src/payloads/add_sticker_to_set.rs +++ b/src/payloads/add_sticker_to_set.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/answer_callback_query.rs b/src/payloads/answer_callback_query.rs index fda34ae4..1ff7f262 100644 --- a/src/payloads/answer_callback_query.rs +++ b/src/payloads/answer_callback_query.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -27,8 +27,8 @@ impl_payload! { /// /// Otherwise, you may use links like `t.me/your\_bot?start=XXXX` that open your bot with a parameter. /// - /// [@Botfather]: https://t.me/botfather /// [`Game`]: crate::types::Game + /// [@Botfather]: https://t.me/botfather /// [callback_game]: https://core.telegram.org/bots/api#inlinekeyboardbutton pub url: String [into], /// The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. diff --git a/src/payloads/answer_inline_query.rs b/src/payloads/answer_inline_query.rs index 7032695b..7c970a97 100644 --- a/src/payloads/answer_inline_query.rs +++ b/src/payloads/answer_inline_query.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -28,8 +28,8 @@ impl_payload! { /// /// _Example_: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an oauth link. Once done, the bot can offer a [switch_inline] button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities. /// - /// [switch_inline]: https://core.telegram.org/bots/api#inlinekeyboardmarkup /// [Deep-linking]: https://core.telegram.org/bots#deep-linking + /// [switch_inline]: https://core.telegram.org/bots/api#inlinekeyboardmarkup pub switch_pm_parameter: String [into], } } diff --git a/src/payloads/answer_pre_checkout_query.rs b/src/payloads/answer_pre_checkout_query.rs index 821bb4ae..ec884ba9 100644 --- a/src/payloads/answer_pre_checkout_query.rs +++ b/src/payloads/answer_pre_checkout_query.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/answer_shipping_query.rs b/src/payloads/answer_shipping_query.rs index a4fc80f7..b00b29c1 100644 --- a/src/payloads/answer_shipping_query.rs +++ b/src/payloads/answer_shipping_query.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/create_new_sticker_set.rs b/src/payloads/create_new_sticker_set.rs index 93f945c4..1b74097a 100644 --- a/src/payloads/create_new_sticker_set.rs +++ b/src/payloads/create_new_sticker_set.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/delete_chat_photo.rs b/src/payloads/delete_chat_photo.rs index dc447a48..23165b38 100644 --- a/src/payloads/delete_chat_photo.rs +++ b/src/payloads/delete_chat_photo.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/delete_chat_sticker_set.rs b/src/payloads/delete_chat_sticker_set.rs index fef2f48b..ba87b16a 100644 --- a/src/payloads/delete_chat_sticker_set.rs +++ b/src/payloads/delete_chat_sticker_set.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/delete_message.rs b/src/payloads/delete_message.rs index cc94d937..cf31bf93 100644 --- a/src/payloads/delete_message.rs +++ b/src/payloads/delete_message.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/delete_sticker_from_set.rs b/src/payloads/delete_sticker_from_set.rs index ec8ca0fb..b432c6ce 100644 --- a/src/payloads/delete_sticker_from_set.rs +++ b/src/payloads/delete_sticker_from_set.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/delete_webhook.rs b/src/payloads/delete_webhook.rs index 3c6906af..ebdd2823 100644 --- a/src/payloads/delete_webhook.rs +++ b/src/payloads/delete_webhook.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/edit_message_caption.rs b/src/payloads/edit_message_caption.rs index aafa4f69..3b626d28 100644 --- a/src/payloads/edit_message_caption.rs +++ b/src/payloads/edit_message_caption.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -16,10 +16,10 @@ impl_payload! { pub chat_id: ChatId [into], /// Identifier of the message to edit pub message_id: i32, - /// New caption of the message, 0-1024 characters after entities parsing - pub caption: String [into], } optional { + /// New caption of the message, 0-1024 characters after entities parsing + pub caption: String [into], /// Mode for parsing entities in the message text. See [formatting options] for more details. /// /// [formatting options]: https://core.telegram.org/bots/api#formatting-options diff --git a/src/payloads/edit_message_caption_inline.rs b/src/payloads/edit_message_caption_inline.rs index fe94044f..565b7486 100644 --- a/src/payloads/edit_message_caption_inline.rs +++ b/src/payloads/edit_message_caption_inline.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -14,10 +14,10 @@ impl_payload! { required { /// Identifier of the inline message pub inline_message_id: String [into], - /// New caption of the message, 0-1024 characters after entities parsing - pub caption: String [into], } optional { + /// New caption of the message, 0-1024 characters after entities parsing + pub caption: String [into], /// Mode for parsing entities in the message text. See [formatting options] for more details. /// /// [formatting options]: https://core.telegram.org/bots/api#formatting-options diff --git a/src/payloads/edit_message_live_location.rs b/src/payloads/edit_message_live_location.rs index 727f46d4..c183cb0a 100644 --- a/src/payloads/edit_message_live_location.rs +++ b/src/payloads/edit_message_live_location.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/edit_message_live_location_inline.rs b/src/payloads/edit_message_live_location_inline.rs index 41bb41a8..79389c4a 100644 --- a/src/payloads/edit_message_live_location_inline.rs +++ b/src/payloads/edit_message_live_location_inline.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -24,8 +24,8 @@ impl_payload! { optional { /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove reply keyboard or to force a reply from the user. /// - /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards + /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating pub reply_markup: ReplyMarkup [into], } } diff --git a/src/payloads/edit_message_media.rs b/src/payloads/edit_message_media.rs index 5e687339..f85aa27f 100644 --- a/src/payloads/edit_message_media.rs +++ b/src/payloads/edit_message_media.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/edit_message_media_inline.rs b/src/payloads/edit_message_media_inline.rs index b5247819..1a3b5d28 100644 --- a/src/payloads/edit_message_media_inline.rs +++ b/src/payloads/edit_message_media_inline.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/edit_message_reply_markup.rs b/src/payloads/edit_message_reply_markup.rs index 4deafeb4..cc7b2777 100644 --- a/src/payloads/edit_message_reply_markup.rs +++ b/src/payloads/edit_message_reply_markup.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/edit_message_reply_markup_inline.rs b/src/payloads/edit_message_reply_markup_inline.rs index 0999db8a..a34db1a6 100644 --- a/src/payloads/edit_message_reply_markup_inline.rs +++ b/src/payloads/edit_message_reply_markup_inline.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/edit_message_text.rs b/src/payloads/edit_message_text.rs index 00a8aa72..fe475bce 100644 --- a/src/payloads/edit_message_text.rs +++ b/src/payloads/edit_message_text.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/edit_message_text_inline.rs b/src/payloads/edit_message_text_inline.rs index d498d71c..758de475 100644 --- a/src/payloads/edit_message_text_inline.rs +++ b/src/payloads/edit_message_text_inline.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/export_chat_invite_link.rs b/src/payloads/export_chat_invite_link.rs index d1d8ce6d..44b5ec3d 100644 --- a/src/payloads/export_chat_invite_link.rs +++ b/src/payloads/export_chat_invite_link.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/forward_message.rs b/src/payloads/forward_message.rs index 336004e6..ce11ac85 100644 --- a/src/payloads/forward_message.rs +++ b/src/payloads/forward_message.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_chat.rs b/src/payloads/get_chat.rs index ce6d6b87..c110722c 100644 --- a/src/payloads/get_chat.rs +++ b/src/payloads/get_chat.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_chat_administrators.rs b/src/payloads/get_chat_administrators.rs index 169987f2..10cf24e4 100644 --- a/src/payloads/get_chat_administrators.rs +++ b/src/payloads/get_chat_administrators.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_chat_member.rs b/src/payloads/get_chat_member.rs index 22eb2aaf..f5e80f55 100644 --- a/src/payloads/get_chat_member.rs +++ b/src/payloads/get_chat_member.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_chat_members_count.rs b/src/payloads/get_chat_members_count.rs index e353ff6d..0fd2c05e 100644 --- a/src/payloads/get_chat_members_count.rs +++ b/src/payloads/get_chat_members_count.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_file.rs b/src/payloads/get_file.rs index 3dfdcfac..47d9225c 100644 --- a/src/payloads/get_file.rs +++ b/src/payloads/get_file.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_game_high_scores.rs b/src/payloads/get_game_high_scores.rs new file mode 100644 index 00000000..2678043a --- /dev/null +++ b/src/payloads/get_game_high_scores.rs @@ -0,0 +1,24 @@ +// This file is auto generated by `cg` (9a82143). +// **DO NOT EDIT THIS FILE**, +// edit `cg` instead. +use serde::Serialize; + +use crate::types::{TargetMessage, True}; + +impl_payload! { + /// Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of [`GameHighScore`] objects. + /// + /// > This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change. + /// + /// [`GameHighScore`]: crate::types::GameHighScore + #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)] + pub GetGameHighScores (GetGameHighScoresSetters) => True { + required { + /// User identifier + pub user_id: u32, + /// Target message + #[serde(flatten)] + pub target: TargetMessage [into], + } + } +} diff --git a/src/payloads/get_me.rs b/src/payloads/get_me.rs index 86cae760..76e97ab7 100644 --- a/src/payloads/get_me.rs +++ b/src/payloads/get_me.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_my_commands.rs b/src/payloads/get_my_commands.rs index 405b6847..bfa35ecb 100644 --- a/src/payloads/get_my_commands.rs +++ b/src/payloads/get_my_commands.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_sticker_set.rs b/src/payloads/get_sticker_set.rs index 10ff4917..35466950 100644 --- a/src/payloads/get_sticker_set.rs +++ b/src/payloads/get_sticker_set.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_updates.rs b/src/payloads/get_updates.rs index 514002da..3dba9e34 100644 --- a/src/payloads/get_updates.rs +++ b/src/payloads/get_updates.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_user_profile_photos.rs b/src/payloads/get_user_profile_photos.rs index 590096e2..9ae52286 100644 --- a/src/payloads/get_user_profile_photos.rs +++ b/src/payloads/get_user_profile_photos.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/get_webhook_info.rs b/src/payloads/get_webhook_info.rs index c342b2a0..846c907a 100644 --- a/src/payloads/get_webhook_info.rs +++ b/src/payloads/get_webhook_info.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/kick_chat_member.rs b/src/payloads/kick_chat_member.rs index 835f33d3..81f5014c 100644 --- a/src/payloads/kick_chat_member.rs +++ b/src/payloads/kick_chat_member.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/leave_chat.rs b/src/payloads/leave_chat.rs index 4c4ee3e2..27af51a1 100644 --- a/src/payloads/leave_chat.rs +++ b/src/payloads/leave_chat.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/mod.rs b/src/payloads/mod.rs index 42b90fe7..abfebc1b 100644 --- a/src/payloads/mod.rs +++ b/src/payloads/mod.rs @@ -11,7 +11,7 @@ /// namespace. pub mod setters; -// This block is auto generated by `cg` (878e847). +// This block is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS BLOCK**, // edit `cg` instead. mod add_sticker_to_set; @@ -42,6 +42,7 @@ mod get_chat_administrators; mod get_chat_member; mod get_chat_members_count; mod get_file; +mod get_game_high_scores; mod get_me; mod get_my_commands; mod get_sticker_set; @@ -59,6 +60,7 @@ mod send_chat_action; mod send_contact; mod send_dice; mod send_document; +mod send_game; mod send_invoice; mod send_location; mod send_media_group; @@ -76,6 +78,8 @@ mod set_chat_permissions; mod set_chat_photo; mod set_chat_sticker_set; mod set_chat_title; +mod set_game_score; +mod set_game_score_inline; mod set_my_commands; mod set_passport_data_errors; mod set_sticker_position_in_set; @@ -120,6 +124,7 @@ pub use get_chat_administrators::{GetChatAdministrators, GetChatAdministratorsSe pub use get_chat_member::{GetChatMember, GetChatMemberSetters}; pub use get_chat_members_count::{GetChatMembersCount, GetChatMembersCountSetters}; pub use get_file::{GetFile, GetFileSetters}; +pub use get_game_high_scores::{GetGameHighScores, GetGameHighScoresSetters}; pub use get_me::{GetMe, GetMeSetters}; pub use get_my_commands::{GetMyCommands, GetMyCommandsSetters}; pub use get_sticker_set::{GetStickerSet, GetStickerSetSetters}; @@ -137,6 +142,7 @@ pub use send_chat_action::{SendChatAction, SendChatActionSetters}; pub use send_contact::{SendContact, SendContactSetters}; pub use send_dice::{SendDice, SendDiceSetters}; pub use send_document::{SendDocument, SendDocumentSetters}; +pub use send_game::{SendGame, SendGameSetters}; pub use send_invoice::{SendInvoice, SendInvoiceSetters}; pub use send_location::{SendLocation, SendLocationSetters}; pub use send_media_group::{SendMediaGroup, SendMediaGroupSetters}; @@ -156,6 +162,8 @@ pub use set_chat_permissions::{SetChatPermissions, SetChatPermissionsSetters}; pub use set_chat_photo::{SetChatPhoto, SetChatPhotoSetters}; pub use set_chat_sticker_set::{SetChatStickerSet, SetChatStickerSetSetters}; pub use set_chat_title::{SetChatTitle, SetChatTitleSetters}; +pub use set_game_score::{SetGameScore, SetGameScoreSetters}; +pub use set_game_score_inline::{SetGameScoreInline, SetGameScoreInlineSetters}; pub use set_my_commands::{SetMyCommands, SetMyCommandsSetters}; pub use set_passport_data_errors::{SetPassportDataErrors, SetPassportDataErrorsSetters}; pub use set_sticker_position_in_set::{SetStickerPositionInSet, SetStickerPositionInSetSetters}; diff --git a/src/payloads/pin_chat_message.rs b/src/payloads/pin_chat_message.rs index 73b03b5f..b3d31f1b 100644 --- a/src/payloads/pin_chat_message.rs +++ b/src/payloads/pin_chat_message.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/promote_chat_member.rs b/src/payloads/promote_chat_member.rs index 71c8cbeb..6d259b4a 100644 --- a/src/payloads/promote_chat_member.rs +++ b/src/payloads/promote_chat_member.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/restrict_chat_member.rs b/src/payloads/restrict_chat_member.rs index 81aa68ff..a168f493 100644 --- a/src/payloads/restrict_chat_member.rs +++ b/src/payloads/restrict_chat_member.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/send_animation.rs b/src/payloads/send_animation.rs index 168c5681..364f821e 100644 --- a/src/payloads/send_animation.rs +++ b/src/payloads/send_animation.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -18,8 +18,6 @@ impl_payload! { /// /// [More info on Sending Files »]: crate::types::InputFile pub animation: InputFile, - /// Animation caption (may also be used when resending videos by _file\_id_), 0-1024 characters after entities parsing - pub caption: String [into], } optional { /// Duration of the animation in seconds @@ -32,6 +30,8 @@ impl_payload! { /// /// [More info on Sending Files »]: crate::types::InputFile pub thumb: 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. /// /// [formatting options]: https://core.telegram.org/bots/api#formatting-options diff --git a/src/payloads/send_audio.rs b/src/payloads/send_audio.rs index 6c7e636c..87cb3de6 100644 --- a/src/payloads/send_audio.rs +++ b/src/payloads/send_audio.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -21,10 +21,10 @@ impl_payload! { /// /// [More info on Sending Files »]: crate::types::InputFile pub audio: InputFile, - /// Audio caption, 0-1024 characters after entities parsing - pub caption: String [into], } optional { + /// Audio caption, 0-1024 characters after entities parsing + pub caption: String [into], /// Mode for parsing entities in the audio caption. See [formatting options] for more details. /// /// [formatting options]: https://core.telegram.org/bots/api#formatting-options diff --git a/src/payloads/send_chat_action.rs b/src/payloads/send_chat_action.rs index d5a4a390..d4e4b859 100644 --- a/src/payloads/send_chat_action.rs +++ b/src/payloads/send_chat_action.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -20,13 +20,13 @@ impl_payload! { pub chat_id: ChatId [into], /// Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for [text messages], upload_photo for [photos], record_video or upload_video for [videos], record_audio or upload_audio for [audio files], upload_document for [general files], find_location for [location data], record_video_note or upload_video_note for [video notes]. /// - /// [audio files]: crate::payloads::SendAudio /// [video notes]: crate::payloads::SendVideoNote - /// [videos]: crate::payloads::SendVideo - /// [text messages]: crate::payloads::SendMessage - /// [photos]: crate::payloads::SendPhoto + /// [audio files]: crate::payloads::SendAudio /// [general files]: crate::payloads::SendDocument /// [location data]: crate::payloads::SendLocation + /// [text messages]: crate::payloads::SendMessage + /// [photos]: crate::payloads::SendPhoto + /// [videos]: crate::payloads::SendVideo pub action: ChatAction, } } diff --git a/src/payloads/send_contact.rs b/src/payloads/send_contact.rs index 6980c662..2f617848 100644 --- a/src/payloads/send_contact.rs +++ b/src/payloads/send_contact.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/send_dice.rs b/src/payloads/send_dice.rs index 755b2b2f..a7400d23 100644 --- a/src/payloads/send_dice.rs +++ b/src/payloads/send_dice.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -26,8 +26,8 @@ impl_payload! { pub reply_to_message_id: i32, /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove reply keyboard or to force a reply from the user. /// - /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards + /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating pub reply_markup: ReplyMarkup [into], } } diff --git a/src/payloads/send_document.rs b/src/payloads/send_document.rs index 2d66f28e..8b9e9fbd 100644 --- a/src/payloads/send_document.rs +++ b/src/payloads/send_document.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -18,14 +18,14 @@ impl_payload! { /// /// [More info on Sending Files »]: crate::types::InputFile pub document: InputFile, - /// Document caption (may also be used when resending documents by _file\_id_), 0-1024 characters after entities parsing - pub caption: String [into], } optional { /// 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://” if the thumbnail was uploaded using multipart/form-data under . [More info on Sending Files »] /// /// [More info on Sending Files »]: crate::types::InputFile pub thumb: 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. /// /// [formatting options]: https://core.telegram.org/bots/api#formatting-options @@ -38,8 +38,8 @@ impl_payload! { pub reply_to_message_id: i32, /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove reply keyboard or to force a reply from the user. /// - /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards + /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating pub reply_markup: ReplyMarkup [into], } } diff --git a/src/payloads/send_game.rs b/src/payloads/send_game.rs new file mode 100644 index 00000000..354573d9 --- /dev/null +++ b/src/payloads/send_game.rs @@ -0,0 +1,21 @@ +// This file is auto generated by `cg` (9a82143). +// **DO NOT EDIT THIS FILE**, +// edit `cg` instead. +use serde::Serialize; + +use crate::types::Message; + +impl_payload! { + /// Use this method to send a game. On success, the sent [`Message`] is returned. + /// + /// [`Message`]: crate::types::Message + #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)] + pub SendGame (SendGameSetters) => Message { + required { + /// Unique identifier for the target chat + pub chat_id: u32, + /// Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather. + pub game_short_name: String [into], + } + } +} diff --git a/src/payloads/send_invoice.rs b/src/payloads/send_invoice.rs index 292cb81a..8941bf16 100644 --- a/src/payloads/send_invoice.rs +++ b/src/payloads/send_invoice.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/send_location.rs b/src/payloads/send_location.rs index fbaef731..f9a213e1 100644 --- a/src/payloads/send_location.rs +++ b/src/payloads/send_location.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -32,8 +32,8 @@ impl_payload! { pub reply_to_message_id: i32, /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove reply keyboard or to force a reply from the user. /// - /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards + /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating pub reply_markup: ReplyMarkup [into], } } diff --git a/src/payloads/send_media_group.rs b/src/payloads/send_media_group.rs index 3799557d..3cdf6a1d 100644 --- a/src/payloads/send_media_group.rs +++ b/src/payloads/send_media_group.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/send_message.rs b/src/payloads/send_message.rs index a4f30955..9157d52f 100644 --- a/src/payloads/send_message.rs +++ b/src/payloads/send_message.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -32,8 +32,8 @@ impl_payload! { pub reply_to_message_id: i32, /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove reply keyboard or to force a reply from the user. /// - /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards + /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating pub reply_markup: ReplyMarkup [into], } } diff --git a/src/payloads/send_photo.rs b/src/payloads/send_photo.rs index 10eeb698..4cc847bf 100644 --- a/src/payloads/send_photo.rs +++ b/src/payloads/send_photo.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -18,10 +18,10 @@ impl_payload! { /// /// [More info on Sending Files »]: crate::types::InputFile pub photo: InputFile, - /// Photo caption (may also be used when resending photos by _file\_id_), 0-1024 characters after entities parsing - pub caption: String [into], } optional { + /// Photo caption (may also be used when resending photos by _file\_id_), 0-1024 characters after entities parsing + pub caption: String [into], /// Mode for parsing entities in the photo caption. See [formatting options] for more details. /// /// [formatting options]: https://core.telegram.org/bots/api#formatting-options @@ -34,8 +34,8 @@ impl_payload! { pub reply_to_message_id: i32, /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove reply keyboard or to force a reply from the user. /// - /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating + /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards pub reply_markup: ReplyMarkup [into], } } diff --git a/src/payloads/send_poll.rs b/src/payloads/send_poll.rs index 59f96801..5a83b5cc 100644 --- a/src/payloads/send_poll.rs +++ b/src/payloads/send_poll.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/send_sticker.rs b/src/payloads/send_sticker.rs index fddf0ddb..234b2951 100644 --- a/src/payloads/send_sticker.rs +++ b/src/payloads/send_sticker.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/send_venue.rs b/src/payloads/send_venue.rs index 355806d1..20ba4eb0 100644 --- a/src/payloads/send_venue.rs +++ b/src/payloads/send_venue.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/send_video.rs b/src/payloads/send_video.rs index c4b40121..e009fd0c 100644 --- a/src/payloads/send_video.rs +++ b/src/payloads/send_video.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -19,8 +19,6 @@ impl_payload! { /// /// [More info on Sending Files »]: crate::types::InputFile pub video: InputFile, - /// Video caption (may also be used when resending videos by _file\_id_), 0-1024 characters after entities parsing - pub caption: String [into], } optional { /// Duration of the video in seconds @@ -33,6 +31,8 @@ impl_payload! { /// /// [More info on Sending Files »]: crate::types::InputFile pub thumb: 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. /// /// [formatting options]: https://core.telegram.org/bots/api#formatting-options diff --git a/src/payloads/send_video_note.rs b/src/payloads/send_video_note.rs index 47d5808a..8aecd4fb 100644 --- a/src/payloads/send_video_note.rs +++ b/src/payloads/send_video_note.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -8,8 +8,8 @@ use crate::types::{ChatId, InputFile, Message, ReplyMarkup}; impl_payload! { /// 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 /// [`Message`]: crate::types::Message + /// [v.4.0]: https://core.telegram.org/bots/api#document #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)] pub SendVideoNote (SendVideoNoteSetters) => Message { required { @@ -37,8 +37,8 @@ impl_payload! { pub reply_to_message_id: i32, /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove reply keyboard or to force a reply from the user. /// - /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards + /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating pub reply_markup: ReplyMarkup [into], } } diff --git a/src/payloads/send_voice.rs b/src/payloads/send_voice.rs index bcea5f38..d30e5b36 100644 --- a/src/payloads/send_voice.rs +++ b/src/payloads/send_voice.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -9,8 +9,8 @@ impl_payload! { /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as [`Audio`] or [`Document`]). On success, the sent [`Message`] is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// [`Audio`]: crate::types::Audio - /// [`Message`]: crate::types::Message /// [`Document`]: crate::types::Document + /// [`Message`]: crate::types::Message #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)] pub SendVoice (SendVoiceSetters) => Message { required { @@ -20,10 +20,10 @@ impl_payload! { /// /// [More info on Sending Files »]: crate::types::InputFile pub voice: InputFile, - /// Voice message caption, 0-1024 characters after entities parsing - pub caption: String [into], } optional { + /// Voice message caption, 0-1024 characters after entities parsing + pub caption: String [into], /// Mode for parsing entities in the voice message caption. See [formatting options] for more details. /// /// [formatting options]: https://core.telegram.org/bots/api#formatting-options diff --git a/src/payloads/set_chat_administrator_custom_title.rs b/src/payloads/set_chat_administrator_custom_title.rs index 414ca72f..31b63c5e 100644 --- a/src/payloads/set_chat_administrator_custom_title.rs +++ b/src/payloads/set_chat_administrator_custom_title.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/set_chat_description.rs b/src/payloads/set_chat_description.rs index 35b88b3f..8abbe59a 100644 --- a/src/payloads/set_chat_description.rs +++ b/src/payloads/set_chat_description.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/set_chat_permissions.rs b/src/payloads/set_chat_permissions.rs index 2c3a5cf9..196b320e 100644 --- a/src/payloads/set_chat_permissions.rs +++ b/src/payloads/set_chat_permissions.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/set_chat_photo.rs b/src/payloads/set_chat_photo.rs index f72c682f..48b518cf 100644 --- a/src/payloads/set_chat_photo.rs +++ b/src/payloads/set_chat_photo.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/set_chat_sticker_set.rs b/src/payloads/set_chat_sticker_set.rs index 9c09328e..e28e569f 100644 --- a/src/payloads/set_chat_sticker_set.rs +++ b/src/payloads/set_chat_sticker_set.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/set_chat_title.rs b/src/payloads/set_chat_title.rs index 76b72b8d..1ccc4b9b 100644 --- a/src/payloads/set_chat_title.rs +++ b/src/payloads/set_chat_title.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/set_game_score.rs b/src/payloads/set_game_score.rs new file mode 100644 index 00000000..8334f64c --- /dev/null +++ b/src/payloads/set_game_score.rs @@ -0,0 +1,33 @@ +// This file is auto generated by `cg` (9a82143). +// **DO NOT EDIT THIS FILE**, +// edit `cg` instead. +use serde::Serialize; + +use crate::types::Message; + +impl_payload! { + /// Use this method to set the score of the specified user in a game. On success, returns the edited [`Message`]. Returns an error, if the new score is not greater than the user's current score in the chat and force is False. + /// + /// See also: [`SetGameScoreInline`](crate::payloads::SetGameScoreInline) + /// + /// [`Message`]: crate::types::Message + #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)] + pub SetGameScore (SetGameScoreSetters) => Message { + required { + /// User identifier + pub user_id: u32, + /// New score + pub score: u64, + /// Unique identifier for the target chat + pub chat_id: u32, + /// Identifier of the message to edit + pub message_id: i64, + } + optional { + /// Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters + pub force: bool, + /// Pass True, if the game message should not be automatically edited to include the current scoreboard + pub disable_edit_message: bool, + } + } +} diff --git a/src/payloads/set_game_score_inline.rs b/src/payloads/set_game_score_inline.rs new file mode 100644 index 00000000..8b53accb --- /dev/null +++ b/src/payloads/set_game_score_inline.rs @@ -0,0 +1,29 @@ +// This file is auto generated by `cg` (9a82143). +// **DO NOT EDIT THIS FILE**, +// edit `cg` instead. +use serde::Serialize; + +use crate::types::Message; + +impl_payload! { + /// Use this method to set the score of the specified user in a game. On success, returns _True_. Returns an error, if the new score is not greater than the user's current score in the chat and force is False. + /// + /// See also: [`SetGameScore`](crate::payloads::SetGameScore) + #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)] + pub SetGameScoreInline (SetGameScoreInlineSetters) => Message { + required { + /// User identifier + pub user_id: u32, + /// New score + pub score: u64, + /// Identifier of the inline message + pub inline_message_id: String [into], + } + optional { + /// Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters + pub force: bool, + /// Pass True, if the game message should not be automatically edited to include the current scoreboard + pub disable_edit_message: bool, + } + } +} diff --git a/src/payloads/set_my_commands.rs b/src/payloads/set_my_commands.rs index 4916fb6a..5cbc46cf 100644 --- a/src/payloads/set_my_commands.rs +++ b/src/payloads/set_my_commands.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/set_passport_data_errors.rs b/src/payloads/set_passport_data_errors.rs index 74ab729a..ebd3ad3a 100644 --- a/src/payloads/set_passport_data_errors.rs +++ b/src/payloads/set_passport_data_errors.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/set_sticker_position_in_set.rs b/src/payloads/set_sticker_position_in_set.rs index 80fad985..8b131b2a 100644 --- a/src/payloads/set_sticker_position_in_set.rs +++ b/src/payloads/set_sticker_position_in_set.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/set_sticker_set_thumb.rs b/src/payloads/set_sticker_set_thumb.rs index b9301535..7b142106 100644 --- a/src/payloads/set_sticker_set_thumb.rs +++ b/src/payloads/set_sticker_set_thumb.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/set_webhook.rs b/src/payloads/set_webhook.rs index b04b5bbc..c73b843f 100644 --- a/src/payloads/set_webhook.rs +++ b/src/payloads/set_webhook.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/setters.rs b/src/payloads/setters.rs index 98b55c80..2947bef2 100644 --- a/src/payloads/setters.rs +++ b/src/payloads/setters.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (878e847). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. @@ -15,18 +15,20 @@ pub use crate::payloads::{ EditMessageTextInlineSetters as _, EditMessageTextSetters as _, ExportChatInviteLinkSetters as _, ForwardMessageSetters as _, GetChatAdministratorsSetters as _, GetChatMemberSetters as _, GetChatMembersCountSetters as _, - GetChatSetters as _, GetFileSetters as _, GetMeSetters as _, GetMyCommandsSetters as _, - GetStickerSetSetters as _, GetUpdatesSetters as _, GetUserProfilePhotosSetters as _, - GetWebhookInfoSetters as _, KickChatMemberSetters as _, LeaveChatSetters as _, - PinChatMessageSetters as _, PromoteChatMemberSetters as _, RestrictChatMemberSetters as _, - SendAnimationSetters as _, SendAudioSetters as _, SendChatActionSetters as _, - SendContactSetters as _, SendDiceSetters as _, SendDocumentSetters as _, - SendInvoiceSetters as _, SendLocationSetters as _, SendMediaGroupSetters as _, - SendMessageSetters as _, SendPhotoSetters as _, SendPollSetters as _, SendStickerSetters as _, - SendVenueSetters as _, SendVideoNoteSetters as _, SendVideoSetters as _, SendVoiceSetters as _, + GetChatSetters as _, GetFileSetters as _, GetGameHighScoresSetters as _, GetMeSetters as _, + GetMyCommandsSetters as _, GetStickerSetSetters as _, GetUpdatesSetters as _, + GetUserProfilePhotosSetters as _, GetWebhookInfoSetters as _, KickChatMemberSetters as _, + LeaveChatSetters as _, PinChatMessageSetters as _, PromoteChatMemberSetters as _, + RestrictChatMemberSetters as _, SendAnimationSetters as _, SendAudioSetters as _, + SendChatActionSetters as _, SendContactSetters as _, SendDiceSetters as _, + SendDocumentSetters as _, SendGameSetters as _, SendInvoiceSetters as _, + SendLocationSetters as _, SendMediaGroupSetters as _, SendMessageSetters as _, + SendPhotoSetters as _, SendPollSetters as _, SendStickerSetters as _, SendVenueSetters as _, + SendVideoNoteSetters as _, SendVideoSetters as _, SendVoiceSetters as _, SetChatAdministratorCustomTitleSetters as _, SetChatDescriptionSetters as _, SetChatPermissionsSetters as _, SetChatPhotoSetters as _, SetChatStickerSetSetters as _, - SetChatTitleSetters as _, SetMyCommandsSetters as _, SetPassportDataErrorsSetters as _, + SetChatTitleSetters as _, SetGameScoreInlineSetters as _, SetGameScoreSetters as _, + SetMyCommandsSetters as _, SetPassportDataErrorsSetters as _, SetStickerPositionInSetSetters as _, SetStickerSetThumbSetters as _, SetWebhookSetters as _, StopMessageLiveLocationInlineSetters as _, StopMessageLiveLocationSetters as _, StopPollSetters as _, UnbanChatMemberSetters as _, UnpinChatMessageSetters as _, diff --git a/src/payloads/stop_message_live_location.rs b/src/payloads/stop_message_live_location.rs index 60c35d58..fdaa08e5 100644 --- a/src/payloads/stop_message_live_location.rs +++ b/src/payloads/stop_message_live_location.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -27,8 +27,8 @@ impl_payload! { optional { /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove reply keyboard or to force a reply from the user. /// - /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating + /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards pub reply_markup: ReplyMarkup [into], } } diff --git a/src/payloads/stop_message_live_location_inline.rs b/src/payloads/stop_message_live_location_inline.rs index 9b0813be..b9e18e98 100644 --- a/src/payloads/stop_message_live_location_inline.rs +++ b/src/payloads/stop_message_live_location_inline.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; @@ -24,8 +24,8 @@ impl_payload! { optional { /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove reply keyboard or to force a reply from the user. /// - /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards + /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating pub reply_markup: ReplyMarkup [into], } } diff --git a/src/payloads/stop_poll.rs b/src/payloads/stop_poll.rs index b0abacbb..d1cf267f 100644 --- a/src/payloads/stop_poll.rs +++ b/src/payloads/stop_poll.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/unban_chat_member.rs b/src/payloads/unban_chat_member.rs index cd9e4fde..76d73e4e 100644 --- a/src/payloads/unban_chat_member.rs +++ b/src/payloads/unban_chat_member.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/unpin_chat_message.rs b/src/payloads/unpin_chat_message.rs index dc78f594..bfc16094 100644 --- a/src/payloads/unpin_chat_message.rs +++ b/src/payloads/unpin_chat_message.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/payloads/upload_sticker_file.rs b/src/payloads/upload_sticker_file.rs index 908f50a3..82957d99 100644 --- a/src/payloads/upload_sticker_file.rs +++ b/src/payloads/upload_sticker_file.rs @@ -1,4 +1,4 @@ -// This file is auto generated by `cg` (e634f65). +// This file is auto generated by `cg` (9a82143). // **DO NOT EDIT THIS FILE**, // edit `cg` instead. use serde::Serialize; diff --git a/src/requests/requester.rs b/src/requests/requester.rs index 87a78331..09ff0641 100644 --- a/src/requests/requester.rs +++ b/src/requests/requester.rs @@ -1,10 +1,13 @@ +// We can't change Telegram API +#![allow(clippy::too_many_arguments)] + use crate::{ payloads::{GetMe, SendMessage, *}, requests::Request, types::{ AllowedUpdate, BotCommand, ChatAction, ChatId, ChatPermissions, DiceEmoji, InlineQueryResult, InputFile, InputMedia, InputSticker, LabeledPrice, PassportElementError, - PollType, + PollType, TargetMessage, }, }; @@ -17,7 +20,7 @@ use crate::{ pub trait Requester { type Err: std::error::Error + Send; - // This block is auto generated by `cg` (a8fa55a). + // This block is auto generated by `cg` (de3765b). // **DO NOT EDIT THIS BLOCK**, // edit `cg` instead. @@ -73,60 +76,44 @@ pub trait Requester { type SendPhoto: Request; /// For Telegram documentation see [`SendPhoto`]. - fn send_photo(&self, chat_id: Ch, photo: InputFile, caption: Ca) -> Self::SendPhoto + fn send_photo(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto where - Ch: Into, - Ca: Into; + C: Into; type SendAudio: Request; /// For Telegram documentation see [`SendAudio`]. - fn send_audio(&self, chat_id: Ch, audio: InputFile, caption: Ca) -> Self::SendAudio + fn send_audio(&self, chat_id: C, audio: InputFile) -> Self::SendAudio where - Ch: Into, - Ca: Into; + C: Into; type SendDocument: Request; /// For Telegram documentation see [`SendDocument`]. - fn send_document( - &self, - chat_id: Ch, - document: InputFile, - caption: Ca, - ) -> Self::SendDocument + fn send_document(&self, chat_id: C, document: InputFile) -> Self::SendDocument where - Ch: Into, - Ca: Into; + C: Into; type SendVideo: Request; /// For Telegram documentation see [`SendVideo`]. - fn send_video(&self, chat_id: Ch, video: InputFile, caption: Ca) -> Self::SendVideo + fn send_video(&self, chat_id: C, video: InputFile) -> Self::SendVideo where - Ch: Into, - Ca: Into; + C: Into; type SendAnimation: Request; /// For Telegram documentation see [`SendAnimation`]. - fn send_animation( - &self, - chat_id: Ch, - animation: InputFile, - caption: Ca, - ) -> Self::SendAnimation + fn send_animation(&self, chat_id: C, animation: InputFile) -> Self::SendAnimation where - Ch: Into, - Ca: Into; + C: Into; type SendVoice: Request; /// For Telegram documentation see [`SendVoice`]. - fn send_voice(&self, chat_id: Ch, voice: InputFile, caption: Ca) -> Self::SendVoice + fn send_voice(&self, chat_id: C, voice: InputFile) -> Self::SendVoice where - Ch: Into, - Ca: Into; + C: Into; type SendVideoNote: Request; @@ -495,27 +482,19 @@ pub trait Requester { type EditMessageCaption: Request; /// For Telegram documentation see [`EditMessageCaption`]. - fn edit_message_caption( - &self, - chat_id: Ch, - message_id: i32, - caption: Ca, - ) -> Self::EditMessageCaption + fn edit_message_caption(&self, chat_id: C, message_id: i32) -> Self::EditMessageCaption where - Ch: Into, - Ca: Into; + C: Into; type EditMessageCaptionInline: Request; /// For Telegram documentation see [`EditMessageCaptionInline`]. - fn edit_message_caption_inline( + fn edit_message_caption_inline( &self, inline_message_id: I, - caption: C, ) -> Self::EditMessageCaptionInline where - I: Into, - C: Into; + I: Into; type EditMessageMedia: Request; @@ -654,7 +633,6 @@ pub trait Requester { type SendInvoice: Request; /// For Telegram documentation see [`SendInvoice`]. - #[allow(clippy::too_many_arguments)] fn send_invoice( &self, chat_id: i32, @@ -699,4 +677,41 @@ pub trait Requester { fn set_passport_data_errors(&self, user_id: i32, errors: E) -> Self::SetPassportDataErrors where E: IntoIterator; + + type SendGame: Request; + + /// For Telegram documentation see [`SendGame`]. + fn send_game(&self, chat_id: u32, game_short_name: G) -> Self::SendGame + where + G: Into; + + type SetGameScore: Request; + + /// For Telegram documentation see [`SetGameScore`]. + fn set_game_score( + &self, + user_id: u32, + score: u64, + chat_id: u32, + message_id: i64, + ) -> Self::SetGameScore; + + type SetGameScoreInline: Request; + + /// For Telegram documentation see [`SetGameScoreInline`]. + fn set_game_score_inline( + &self, + user_id: u32, + score: u64, + inline_message_id: I, + ) -> Self::SetGameScoreInline + where + I: Into; + + type GetGameHighScores: Request; + + /// For Telegram documentation see [`GetGameHighScores`]. + fn get_game_high_scores(&self, user_id: u32, target: T) -> Self::GetGameHighScores + where + T: Into; }