Merge pull request #34 from teloxide/tgapi_typos

Fix API typos
This commit is contained in:
Temirkhan Myrzamadi 2020-12-28 18:26:15 +06:00 committed by GitHub
commit 42d4c7693a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
86 changed files with 493 additions and 291 deletions

View file

@ -78,21 +78,27 @@ impl<B: Requester> Requester for AutoSend<B> {
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
}
}

View file

@ -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
}
}

View file

@ -93,17 +93,23 @@ impl<B: Requester> Requester for DefaultParseMode<B> {
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
}
}

View file

@ -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
}
}

View file

@ -76,78 +76,56 @@ impl Requester for Bot {
type SendPhoto = MultipartRequest<payloads::SendPhoto>;
fn send_photo<Ch, Ca>(&self, chat_id: Ch, photo: InputFile, caption: Ca) -> Self::SendPhoto
fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto
where
Ch: Into<ChatId>,
Ca: Into<String>,
C: Into<ChatId>,
{
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<payloads::SendAudio>;
fn send_audio<Ch, Ca>(&self, chat_id: Ch, audio: InputFile, caption: Ca) -> Self::SendAudio
fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio
where
Ch: Into<ChatId>,
Ca: Into<String>,
C: Into<ChatId>,
{
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<payloads::SendDocument>;
fn send_document<Ch, Ca>(
&self,
chat_id: Ch,
document: InputFile,
caption: Ca,
) -> Self::SendDocument
fn send_document<C>(&self, chat_id: C, document: InputFile) -> Self::SendDocument
where
Ch: Into<ChatId>,
Ca: Into<String>,
C: Into<ChatId>,
{
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<payloads::SendVideo>;
fn send_video<Ch, Ca>(&self, chat_id: Ch, video: InputFile, caption: Ca) -> Self::SendVideo
fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo
where
Ch: Into<ChatId>,
Ca: Into<String>,
C: Into<ChatId>,
{
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<payloads::SendAnimation>;
fn send_animation<Ch, Ca>(
&self,
chat_id: Ch,
animation: InputFile,
caption: Ca,
) -> Self::SendAnimation
fn send_animation<C>(&self, chat_id: C, animation: InputFile) -> Self::SendAnimation
where
Ch: Into<ChatId>,
Ca: Into<String>,
C: Into<ChatId>,
{
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<payloads::SendVoice>;
fn send_voice<Ch, Ca>(&self, chat_id: Ch, voice: InputFile, caption: Ca) -> Self::SendVoice
fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice
where
Ch: Into<ChatId>,
Ca: Into<String>,
C: Into<ChatId>,
{
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<payloads::SendVideoNote>;
@ -634,36 +612,25 @@ impl Requester for Bot {
type EditMessageCaption = JsonRequest<payloads::EditMessageCaption>;
fn edit_message_caption<Ch, Ca>(
&self,
chat_id: Ch,
message_id: i32,
caption: Ca,
) -> Self::EditMessageCaption
fn edit_message_caption<C>(&self, chat_id: C, message_id: i32) -> Self::EditMessageCaption
where
Ch: Into<ChatId>,
Ca: Into<String>,
C: Into<ChatId>,
{
Self::EditMessageCaption::new(
self.clone(),
payloads::EditMessageCaption::new(chat_id, message_id, caption),
payloads::EditMessageCaption::new(chat_id, message_id),
)
}
type EditMessageCaptionInline = JsonRequest<payloads::EditMessageCaptionInline>;
fn edit_message_caption_inline<I, C>(
&self,
inline_message_id: I,
caption: C,
) -> Self::EditMessageCaptionInline
fn edit_message_caption_inline<I>(&self, inline_message_id: I) -> Self::EditMessageCaptionInline
where
I: Into<String>,
C: Into<String>,
{
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<payloads::SendGame>;
fn send_game<G>(&self, chat_id: u32, game_short_name: G) -> Self::SendGame
where
G: Into<String>,
{
Self::SendGame::new(self.clone(), payloads::SendGame::new(chat_id, game_short_name))
}
type SetGameScore = JsonRequest<payloads::SetGameScore>;
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<payloads::SetGameScoreInline>;
fn set_game_score_inline<I>(
&self,
user_id: u32,
score: u64,
inline_message_id: I,
) -> Self::SetGameScoreInline
where
I: Into<String>,
{
Self::SetGameScoreInline::new(
self.clone(),
payloads::SetGameScoreInline::new(user_id, score, inline_message_id),
)
}
type GetGameHighScores = JsonRequest<payloads::GetGameHighScores>;
fn get_game_high_scores<T>(&self, user_id: u32, target: T) -> Self::GetGameHighScores
where
T: Into<crate::types::TargetMessage>,
{
Self::GetGameHighScores::new(
self.clone(),
payloads::GetGameHighScores::new(user_id, target),
)
}
}

View file

@ -373,7 +373,7 @@ macro_rules! impl_payload {
}
#[macro_use]
// This macro is auto generated by `cg` <https://github.com/teloxide/cg> (a8fa55a).
// This macro is auto generated by `cg` <https://github.com/teloxide/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<Ch, Ca>(&self, chat_id: Ch, photo: InputFile, caption: Ca) -> Self::SendPhoto where Ch: Into<ChatId>,
Ca: Into<String> {
fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto where C: Into<ChatId> {
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<Ch, Ca>(&self, chat_id: Ch, audio: InputFile, caption: Ca) -> Self::SendAudio where Ch: Into<ChatId>,
Ca: Into<String> {
fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio where C: Into<ChatId> {
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<Ch, Ca>(&self, chat_id: Ch, document: InputFile, caption: Ca) -> Self::SendDocument where Ch: Into<ChatId>,
Ca: Into<String> {
fn send_document<C>(&self, chat_id: C, document: InputFile) -> Self::SendDocument where C: Into<ChatId> {
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<Ch, Ca>(&self, chat_id: Ch, video: InputFile, caption: Ca) -> Self::SendVideo where Ch: Into<ChatId>,
Ca: Into<String> {
fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo where C: Into<ChatId> {
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<Ch, Ca>(&self, chat_id: Ch, animation: InputFile, caption: Ca) -> Self::SendAnimation where Ch: Into<ChatId>,
Ca: Into<String> {
fn send_animation<C>(&self, chat_id: C, animation: InputFile) -> Self::SendAnimation where C: Into<ChatId> {
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<Ch, Ca>(&self, chat_id: Ch, voice: InputFile, caption: Ca) -> Self::SendVoice where Ch: Into<ChatId>,
Ca: Into<String> {
fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice where C: Into<ChatId> {
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<Ch, Ca>(&self, chat_id: Ch, message_id: i32, caption: Ca) -> Self::EditMessageCaption where Ch: Into<ChatId>,
Ca: Into<String> {
fn edit_message_caption<C>(&self, chat_id: C, message_id: i32) -> Self::EditMessageCaption where C: Into<ChatId> {
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<I, C>(&self, inline_message_id: I, caption: C) -> Self::EditMessageCaptionInline where I: Into<String>,
C: Into<String> {
fn edit_message_caption_inline<I>(&self, inline_message_id: I) -> Self::EditMessageCaptionInline where I: Into<String> {
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<G>(&self, chat_id: u32, game_short_name: G) -> Self::SendGame where G: Into<String> {
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<I>(&self, user_id: u32, score: u64, inline_message_id: I) -> Self::SetGameScoreInline where I: Into<String> {
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<T>(&self, user_id: u32, target: T) -> Self::GetGameHighScores where T: Into<TargetMessage> {
let this = self;
$body!(get_game_high_scores this (user_id: u32, target: T))
}
};
}
#[macro_use]

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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.

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -0,0 +1,24 @@
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -11,7 +11,7 @@
/// namespace.
pub mod setters;
// This block is auto generated by `cg` <https://github.com/teloxide/cg> (878e847).
// This block is auto generated by `cg` <https://github.com/teloxide/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};

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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,
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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://<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,
/// 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],
}
}

21
src/payloads/send_game.rs Normal file
View file

@ -0,0 +1,21 @@
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -0,0 +1,33 @@
// This file is auto generated by `cg` <https://github.com/teloxide/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,
}
}
}

View file

@ -0,0 +1,29 @@
// This file is auto generated by `cg` <https://github.com/teloxide/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,
}
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (878e847).
// This file is auto generated by `cg` <https://github.com/teloxide/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 _,

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/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],
}
}

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -1,4 +1,4 @@
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (e634f65).
// This file is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143).
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;

View file

@ -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` <https://github.com/teloxide/cg> (a8fa55a).
// This block is auto generated by `cg` <https://github.com/teloxide/cg> (de3765b).
// **DO NOT EDIT THIS BLOCK**,
// edit `cg` instead.
@ -73,60 +76,44 @@ pub trait Requester {
type SendPhoto: Request<Payload = SendPhoto, Err = Self::Err>;
/// For Telegram documentation see [`SendPhoto`].
fn send_photo<Ch, Ca>(&self, chat_id: Ch, photo: InputFile, caption: Ca) -> Self::SendPhoto
fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto
where
Ch: Into<ChatId>,
Ca: Into<String>;
C: Into<ChatId>;
type SendAudio: Request<Payload = SendAudio, Err = Self::Err>;
/// For Telegram documentation see [`SendAudio`].
fn send_audio<Ch, Ca>(&self, chat_id: Ch, audio: InputFile, caption: Ca) -> Self::SendAudio
fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio
where
Ch: Into<ChatId>,
Ca: Into<String>;
C: Into<ChatId>;
type SendDocument: Request<Payload = SendDocument, Err = Self::Err>;
/// For Telegram documentation see [`SendDocument`].
fn send_document<Ch, Ca>(
&self,
chat_id: Ch,
document: InputFile,
caption: Ca,
) -> Self::SendDocument
fn send_document<C>(&self, chat_id: C, document: InputFile) -> Self::SendDocument
where
Ch: Into<ChatId>,
Ca: Into<String>;
C: Into<ChatId>;
type SendVideo: Request<Payload = SendVideo, Err = Self::Err>;
/// For Telegram documentation see [`SendVideo`].
fn send_video<Ch, Ca>(&self, chat_id: Ch, video: InputFile, caption: Ca) -> Self::SendVideo
fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo
where
Ch: Into<ChatId>,
Ca: Into<String>;
C: Into<ChatId>;
type SendAnimation: Request<Payload = SendAnimation, Err = Self::Err>;
/// For Telegram documentation see [`SendAnimation`].
fn send_animation<Ch, Ca>(
&self,
chat_id: Ch,
animation: InputFile,
caption: Ca,
) -> Self::SendAnimation
fn send_animation<C>(&self, chat_id: C, animation: InputFile) -> Self::SendAnimation
where
Ch: Into<ChatId>,
Ca: Into<String>;
C: Into<ChatId>;
type SendVoice: Request<Payload = SendVoice, Err = Self::Err>;
/// For Telegram documentation see [`SendVoice`].
fn send_voice<Ch, Ca>(&self, chat_id: Ch, voice: InputFile, caption: Ca) -> Self::SendVoice
fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice
where
Ch: Into<ChatId>,
Ca: Into<String>;
C: Into<ChatId>;
type SendVideoNote: Request<Payload = SendVideoNote, Err = Self::Err>;
@ -495,27 +482,19 @@ pub trait Requester {
type EditMessageCaption: Request<Payload = EditMessageCaption, Err = Self::Err>;
/// For Telegram documentation see [`EditMessageCaption`].
fn edit_message_caption<Ch, Ca>(
&self,
chat_id: Ch,
message_id: i32,
caption: Ca,
) -> Self::EditMessageCaption
fn edit_message_caption<C>(&self, chat_id: C, message_id: i32) -> Self::EditMessageCaption
where
Ch: Into<ChatId>,
Ca: Into<String>;
C: Into<ChatId>;
type EditMessageCaptionInline: Request<Payload = EditMessageCaptionInline, Err = Self::Err>;
/// For Telegram documentation see [`EditMessageCaptionInline`].
fn edit_message_caption_inline<I, C>(
fn edit_message_caption_inline<I>(
&self,
inline_message_id: I,
caption: C,
) -> Self::EditMessageCaptionInline
where
I: Into<String>,
C: Into<String>;
I: Into<String>;
type EditMessageMedia: Request<Payload = EditMessageMedia, Err = Self::Err>;
@ -654,7 +633,6 @@ pub trait Requester {
type SendInvoice: Request<Payload = SendInvoice, Err = Self::Err>;
/// For Telegram documentation see [`SendInvoice`].
#[allow(clippy::too_many_arguments)]
fn send_invoice<T, D, Pa, P, S, C, Pri>(
&self,
chat_id: i32,
@ -699,4 +677,41 @@ pub trait Requester {
fn set_passport_data_errors<E>(&self, user_id: i32, errors: E) -> Self::SetPassportDataErrors
where
E: IntoIterator<Item = PassportElementError>;
type SendGame: Request<Payload = SendGame, Err = Self::Err>;
/// For Telegram documentation see [`SendGame`].
fn send_game<G>(&self, chat_id: u32, game_short_name: G) -> Self::SendGame
where
G: Into<String>;
type SetGameScore: Request<Payload = SetGameScore, Err = Self::Err>;
/// 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<Payload = SetGameScoreInline, Err = Self::Err>;
/// For Telegram documentation see [`SetGameScoreInline`].
fn set_game_score_inline<I>(
&self,
user_id: u32,
score: u64,
inline_message_id: I,
) -> Self::SetGameScoreInline
where
I: Into<String>;
type GetGameHighScores: Request<Payload = GetGameHighScores, Err = Self::Err>;
/// For Telegram documentation see [`GetGameHighScores`].
fn get_game_high_scores<T>(&self, user_id: u32, target: T) -> Self::GetGameHighScores
where
T: Into<TargetMessage>;
}