mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Add TBA 6.0 methods
This commit is contained in:
parent
cb8f373054
commit
d61fe4f85d
17 changed files with 333 additions and 27 deletions
|
@ -97,7 +97,7 @@ where
|
|||
set_chat_description, pin_chat_message, unpin_chat_message, unpin_all_chat_messages,
|
||||
leave_chat, get_chat, get_chat_administrators, get_chat_members_count, get_chat_member_count, get_chat_member,
|
||||
set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query,
|
||||
set_my_commands, get_my_commands, delete_my_commands, answer_inline_query, edit_message_text,
|
||||
set_my_commands, get_my_commands, set_chat_menu_button, get_chat_menu_button, set_my_default_administrator_rights, get_my_default_administrator_rights, delete_my_commands, answer_inline_query, answer_web_app_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,
|
||||
|
|
|
@ -104,7 +104,7 @@ where
|
|||
set_chat_description, pin_chat_message, unpin_chat_message, unpin_all_chat_messages,
|
||||
leave_chat, get_chat, get_chat_administrators, get_chat_members_count, get_chat_member_count, get_chat_member,
|
||||
set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query,
|
||||
set_my_commands, get_my_commands, delete_my_commands, answer_inline_query, edit_message_text,
|
||||
set_my_commands, get_my_commands, set_chat_menu_button, get_chat_menu_button, set_my_default_administrator_rights, get_my_default_administrator_rights, delete_my_commands, answer_inline_query, answer_web_app_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,
|
||||
|
|
|
@ -170,7 +170,7 @@ where
|
|||
set_chat_description, pin_chat_message, unpin_chat_message, unpin_all_chat_messages,
|
||||
leave_chat, get_chat, get_chat_administrators, get_chat_members_count, get_chat_member_count, get_chat_member,
|
||||
set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query,
|
||||
set_my_commands, get_my_commands, delete_my_commands, answer_inline_query, edit_message_text,
|
||||
set_my_commands, get_my_commands, set_chat_menu_button, get_chat_menu_button, set_my_default_administrator_rights, get_my_default_administrator_rights, delete_my_commands, answer_inline_query, answer_web_app_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,
|
||||
|
@ -523,6 +523,18 @@ trait ErasableRequester<'a> {
|
|||
|
||||
fn get_my_commands(&self) -> ErasedRequest<'a, GetMyCommands, Self::Err>;
|
||||
|
||||
fn set_chat_menu_button(&self) -> ErasedRequest<'a, SetChatMenuButton, Self::Err>;
|
||||
|
||||
fn get_chat_menu_button(&self) -> ErasedRequest<'a, GetChatMenuButton, Self::Err>;
|
||||
|
||||
fn set_my_default_administrator_rights(
|
||||
&self,
|
||||
) -> ErasedRequest<'a, SetMyDefaultAdministratorRights, Self::Err>;
|
||||
|
||||
fn get_my_default_administrator_rights(
|
||||
&self,
|
||||
) -> ErasedRequest<'a, GetMyDefaultAdministratorRights, Self::Err>;
|
||||
|
||||
fn delete_my_commands(&self) -> ErasedRequest<'a, DeleteMyCommands, Self::Err>;
|
||||
|
||||
fn answer_inline_query(
|
||||
|
@ -531,6 +543,12 @@ trait ErasableRequester<'a> {
|
|||
results: Vec<InlineQueryResult>,
|
||||
) -> ErasedRequest<'a, AnswerInlineQuery, Self::Err>;
|
||||
|
||||
fn answer_web_app_query(
|
||||
&self,
|
||||
web_app_query_id: String,
|
||||
result: InlineQueryResult,
|
||||
) -> ErasedRequest<'a, AnswerWebAppQuery, Self::Err>;
|
||||
|
||||
fn edit_message_text(
|
||||
&self,
|
||||
chat_id: Recipient,
|
||||
|
@ -1169,6 +1187,26 @@ where
|
|||
Requester::get_my_commands(self).erase()
|
||||
}
|
||||
|
||||
fn set_chat_menu_button(&self) -> ErasedRequest<'a, SetChatMenuButton, Self::Err> {
|
||||
Requester::set_chat_menu_button(self).erase()
|
||||
}
|
||||
|
||||
fn get_chat_menu_button(&self) -> ErasedRequest<'a, GetChatMenuButton, Self::Err> {
|
||||
Requester::get_chat_menu_button(self).erase()
|
||||
}
|
||||
|
||||
fn set_my_default_administrator_rights(
|
||||
&self,
|
||||
) -> ErasedRequest<'a, SetMyDefaultAdministratorRights, Self::Err> {
|
||||
Requester::set_my_default_administrator_rights(self).erase()
|
||||
}
|
||||
|
||||
fn get_my_default_administrator_rights(
|
||||
&self,
|
||||
) -> ErasedRequest<'a, GetMyDefaultAdministratorRights, Self::Err> {
|
||||
Requester::get_my_default_administrator_rights(self).erase()
|
||||
}
|
||||
|
||||
fn delete_my_commands(&self) -> ErasedRequest<'a, DeleteMyCommands, Self::Err> {
|
||||
Requester::delete_my_commands(self).erase()
|
||||
}
|
||||
|
@ -1181,6 +1219,14 @@ where
|
|||
Requester::answer_inline_query(self, inline_query_id, results).erase()
|
||||
}
|
||||
|
||||
fn answer_web_app_query(
|
||||
&self,
|
||||
web_app_query_id: String,
|
||||
result: InlineQueryResult,
|
||||
) -> ErasedRequest<'a, AnswerWebAppQuery, Self::Err> {
|
||||
Requester::answer_web_app_query(self, web_app_query_id, result).erase()
|
||||
}
|
||||
|
||||
fn edit_message_text(
|
||||
&self,
|
||||
chat_id: Recipient,
|
||||
|
|
|
@ -109,7 +109,7 @@ impl<B: Requester> Requester for DefaultParseMode<B> {
|
|||
set_chat_description, pin_chat_message, unpin_chat_message, unpin_all_chat_messages,
|
||||
leave_chat, get_chat, get_chat_administrators, get_chat_members_count, get_chat_member_count, get_chat_member,
|
||||
set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query,
|
||||
set_my_commands, get_my_commands, delete_my_commands, answer_inline_query,
|
||||
set_my_commands, get_my_commands, set_chat_menu_button, get_chat_menu_button, set_my_default_administrator_rights, get_my_default_administrator_rights, delete_my_commands, answer_inline_query, answer_web_app_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,
|
||||
|
|
|
@ -82,7 +82,7 @@ where
|
|||
set_chat_description, pin_chat_message, unpin_chat_message, unpin_all_chat_messages,
|
||||
leave_chat, get_chat, get_chat_administrators, get_chat_members_count, get_chat_member_count,
|
||||
get_chat_member, set_chat_sticker_set, delete_chat_sticker_set,
|
||||
answer_callback_query, set_my_commands, get_my_commands, delete_my_commands, answer_inline_query,
|
||||
answer_callback_query, set_my_commands, get_my_commands, set_chat_menu_button, get_chat_menu_button, set_my_default_administrator_rights, get_my_default_administrator_rights, delete_my_commands, answer_inline_query, answer_web_app_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,
|
||||
|
|
|
@ -129,7 +129,7 @@ where
|
|||
set_chat_description, pin_chat_message, unpin_chat_message, unpin_all_chat_messages,
|
||||
leave_chat, get_chat, get_chat_administrators, get_chat_members_count, get_chat_member_count, get_chat_member,
|
||||
set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query,
|
||||
set_my_commands, get_my_commands, delete_my_commands, answer_inline_query, edit_message_text,
|
||||
set_my_commands, get_my_commands, set_chat_menu_button, get_chat_menu_button, set_my_default_administrator_rights, get_my_default_administrator_rights, delete_my_commands, answer_inline_query, answer_web_app_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,
|
||||
|
|
|
@ -689,6 +689,36 @@ impl Requester for Bot {
|
|||
Self::GetMyCommands::new(self.clone(), payloads::GetMyCommands::new())
|
||||
}
|
||||
|
||||
type SetChatMenuButton = JsonRequest<payloads::SetChatMenuButton>;
|
||||
|
||||
fn set_chat_menu_button(&self) -> Self::SetChatMenuButton {
|
||||
Self::SetChatMenuButton::new(self.clone(), payloads::SetChatMenuButton::new())
|
||||
}
|
||||
|
||||
type GetChatMenuButton = JsonRequest<payloads::GetChatMenuButton>;
|
||||
|
||||
fn get_chat_menu_button(&self) -> Self::GetChatMenuButton {
|
||||
Self::GetChatMenuButton::new(self.clone(), payloads::GetChatMenuButton::new())
|
||||
}
|
||||
|
||||
type SetMyDefaultAdministratorRights = JsonRequest<payloads::SetMyDefaultAdministratorRights>;
|
||||
|
||||
fn set_my_default_administrator_rights(&self) -> Self::SetMyDefaultAdministratorRights {
|
||||
Self::SetMyDefaultAdministratorRights::new(
|
||||
self.clone(),
|
||||
payloads::SetMyDefaultAdministratorRights::new(),
|
||||
)
|
||||
}
|
||||
|
||||
type GetMyDefaultAdministratorRights = JsonRequest<payloads::GetMyDefaultAdministratorRights>;
|
||||
|
||||
fn get_my_default_administrator_rights(&self) -> Self::GetMyDefaultAdministratorRights {
|
||||
Self::GetMyDefaultAdministratorRights::new(
|
||||
self.clone(),
|
||||
payloads::GetMyDefaultAdministratorRights::new(),
|
||||
)
|
||||
}
|
||||
|
||||
type DeleteMyCommands = JsonRequest<payloads::DeleteMyCommands>;
|
||||
|
||||
fn delete_my_commands(&self) -> Self::DeleteMyCommands {
|
||||
|
@ -708,6 +738,22 @@ impl Requester for Bot {
|
|||
)
|
||||
}
|
||||
|
||||
type AnswerWebAppQuery = JsonRequest<payloads::AnswerWebAppQuery>;
|
||||
|
||||
fn answer_web_app_query<W>(
|
||||
&self,
|
||||
web_app_query_id: W,
|
||||
result: InlineQueryResult,
|
||||
) -> Self::AnswerWebAppQuery
|
||||
where
|
||||
W: Into<String>,
|
||||
{
|
||||
Self::AnswerWebAppQuery::new(
|
||||
self.clone(),
|
||||
payloads::AnswerWebAppQuery::new(web_app_query_id, result),
|
||||
)
|
||||
}
|
||||
|
||||
type EditMessageText = JsonRequest<payloads::EditMessageText>;
|
||||
|
||||
fn edit_message_text<C, T>(&self, chat_id: C, message_id: i32, text: T) -> Self::EditMessageText
|
||||
|
|
|
@ -943,6 +943,38 @@ macro_rules! requester_forward {
|
|||
$body!(get_my_commands this ())
|
||||
}
|
||||
};
|
||||
(@method set_chat_menu_button $body:ident $ty:ident) => {
|
||||
type SetChatMenuButton = $ty![SetChatMenuButton];
|
||||
|
||||
fn set_chat_menu_button(&self) -> Self::SetChatMenuButton {
|
||||
let this = self;
|
||||
$body!(set_chat_menu_button this ())
|
||||
}
|
||||
};
|
||||
(@method get_chat_menu_button $body:ident $ty:ident) => {
|
||||
type GetChatMenuButton = $ty![GetChatMenuButton];
|
||||
|
||||
fn get_chat_menu_button(&self) -> Self::GetChatMenuButton {
|
||||
let this = self;
|
||||
$body!(get_chat_menu_button this ())
|
||||
}
|
||||
};
|
||||
(@method set_my_default_administrator_rights $body:ident $ty:ident) => {
|
||||
type SetMyDefaultAdministratorRights = $ty![SetMyDefaultAdministratorRights];
|
||||
|
||||
fn set_my_default_administrator_rights(&self) -> Self::SetMyDefaultAdministratorRights {
|
||||
let this = self;
|
||||
$body!(set_my_default_administrator_rights this ())
|
||||
}
|
||||
};
|
||||
(@method get_my_default_administrator_rights $body:ident $ty:ident) => {
|
||||
type GetMyDefaultAdministratorRights = $ty![GetMyDefaultAdministratorRights];
|
||||
|
||||
fn get_my_default_administrator_rights(&self) -> Self::GetMyDefaultAdministratorRights {
|
||||
let this = self;
|
||||
$body!(get_my_default_administrator_rights this ())
|
||||
}
|
||||
};
|
||||
(@method delete_my_commands $body:ident $ty:ident) => {
|
||||
type DeleteMyCommands = $ty![DeleteMyCommands];
|
||||
|
||||
|
@ -960,6 +992,14 @@ macro_rules! requester_forward {
|
|||
$body!(answer_inline_query this (inline_query_id: I, results: R))
|
||||
}
|
||||
};
|
||||
(@method answer_web_app_query $body:ident $ty:ident) => {
|
||||
type AnswerWebAppQuery = $ty![AnswerWebAppQuery];
|
||||
|
||||
fn answer_web_app_query<W>(&self, web_app_query_id: W, result: InlineQueryResult) -> Self::AnswerWebAppQuery where W: Into<String> {
|
||||
let this = self;
|
||||
$body!(answer_web_app_query this (web_app_query_id: W, result: InlineQueryResult))
|
||||
}
|
||||
};
|
||||
(@method edit_message_text $body:ident $ty:ident) => {
|
||||
type EditMessageText = $ty![EditMessageText];
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ mod answer_callback_query;
|
|||
mod answer_inline_query;
|
||||
mod answer_pre_checkout_query;
|
||||
mod answer_shipping_query;
|
||||
mod answer_web_app_query;
|
||||
mod approve_chat_join_request;
|
||||
mod ban_chat_member;
|
||||
mod ban_chat_sender_chat;
|
||||
|
@ -57,10 +58,12 @@ mod get_chat_administrators;
|
|||
mod get_chat_member;
|
||||
mod get_chat_member_count;
|
||||
mod get_chat_members_count;
|
||||
mod get_chat_menu_button;
|
||||
mod get_file;
|
||||
mod get_game_high_scores;
|
||||
mod get_me;
|
||||
mod get_my_commands;
|
||||
mod get_my_default_administrator_rights;
|
||||
mod get_sticker_set;
|
||||
mod get_updates;
|
||||
mod get_user_profile_photos;
|
||||
|
@ -92,6 +95,7 @@ mod send_video_note;
|
|||
mod send_voice;
|
||||
mod set_chat_administrator_custom_title;
|
||||
mod set_chat_description;
|
||||
mod set_chat_menu_button;
|
||||
mod set_chat_permissions;
|
||||
mod set_chat_photo;
|
||||
mod set_chat_sticker_set;
|
||||
|
@ -99,6 +103,7 @@ mod set_chat_title;
|
|||
mod set_game_score;
|
||||
mod set_game_score_inline;
|
||||
mod set_my_commands;
|
||||
mod set_my_default_administrator_rights;
|
||||
mod set_passport_data_errors;
|
||||
mod set_sticker_position_in_set;
|
||||
mod set_sticker_set_thumb;
|
||||
|
@ -117,6 +122,7 @@ pub use answer_callback_query::{AnswerCallbackQuery, AnswerCallbackQuerySetters}
|
|||
pub use answer_inline_query::{AnswerInlineQuery, AnswerInlineQuerySetters};
|
||||
pub use answer_pre_checkout_query::{AnswerPreCheckoutQuery, AnswerPreCheckoutQuerySetters};
|
||||
pub use answer_shipping_query::{AnswerShippingQuery, AnswerShippingQuerySetters};
|
||||
pub use answer_web_app_query::{AnswerWebAppQuery, AnswerWebAppQuerySetters};
|
||||
pub use approve_chat_join_request::{ApproveChatJoinRequest, ApproveChatJoinRequestSetters};
|
||||
pub use ban_chat_member::{BanChatMember, BanChatMemberSetters};
|
||||
pub use ban_chat_sender_chat::{BanChatSenderChat, BanChatSenderChatSetters};
|
||||
|
@ -153,10 +159,14 @@ pub use get_chat_administrators::{GetChatAdministrators, GetChatAdministratorsSe
|
|||
pub use get_chat_member::{GetChatMember, GetChatMemberSetters};
|
||||
pub use get_chat_member_count::{GetChatMemberCount, GetChatMemberCountSetters};
|
||||
pub use get_chat_members_count::{GetChatMembersCount, GetChatMembersCountSetters};
|
||||
pub use get_chat_menu_button::{GetChatMenuButton, GetChatMenuButtonSetters};
|
||||
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_my_default_administrator_rights::{
|
||||
GetMyDefaultAdministratorRights, GetMyDefaultAdministratorRightsSetters,
|
||||
};
|
||||
pub use get_sticker_set::{GetStickerSet, GetStickerSetSetters};
|
||||
pub use get_updates::{GetUpdates, GetUpdatesSetters};
|
||||
pub use get_user_profile_photos::{GetUserProfilePhotos, GetUserProfilePhotosSetters};
|
||||
|
@ -190,6 +200,7 @@ pub use set_chat_administrator_custom_title::{
|
|||
SetChatAdministratorCustomTitle, SetChatAdministratorCustomTitleSetters,
|
||||
};
|
||||
pub use set_chat_description::{SetChatDescription, SetChatDescriptionSetters};
|
||||
pub use set_chat_menu_button::{SetChatMenuButton, SetChatMenuButtonSetters};
|
||||
pub use set_chat_permissions::{SetChatPermissions, SetChatPermissionsSetters};
|
||||
pub use set_chat_photo::{SetChatPhoto, SetChatPhotoSetters};
|
||||
pub use set_chat_sticker_set::{SetChatStickerSet, SetChatStickerSetSetters};
|
||||
|
@ -197,6 +208,9 @@ 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_my_default_administrator_rights::{
|
||||
SetMyDefaultAdministratorRights, SetMyDefaultAdministratorRightsSetters,
|
||||
};
|
||||
pub use set_passport_data_errors::{SetPassportDataErrors, SetPassportDataErrorsSetters};
|
||||
pub use set_sticker_position_in_set::{SetStickerPositionInSet, SetStickerPositionInSetSetters};
|
||||
pub use set_sticker_set_thumb::{SetStickerSetThumb, SetStickerSetThumbSetters};
|
||||
|
@ -211,5 +225,3 @@ pub use unban_chat_sender_chat::{UnbanChatSenderChat, UnbanChatSenderChatSetters
|
|||
pub use unpin_all_chat_messages::{UnpinAllChatMessages, UnpinAllChatMessagesSetters};
|
||||
pub use unpin_chat_message::{UnpinChatMessage, UnpinChatMessageSetters};
|
||||
pub use upload_sticker_file::{UploadStickerFile, UploadStickerFileSetters};
|
||||
|
||||
// end of auto generated block
|
||||
|
|
26
src/payloads/answer_web_app_query.rs
Normal file
26
src/payloads/answer_web_app_query.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
// This file is auto generated by [`cg`] from [`schema`].
|
||||
//
|
||||
// **DO NOT EDIT THIS FILE**,
|
||||
//
|
||||
// Edit `cg` or `schema` instead.
|
||||
//
|
||||
// [cg]: https://github.com/teloxide/cg
|
||||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::{InlineQueryResult, SentWebAppMessage};
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method to set the result of an interaction with a [Web App] and send a corresponding message on behalf of the user to the chat from which the query originated.
|
||||
///
|
||||
/// [Web App]: https://core.telegram.org/bots/webapps
|
||||
#[derive(Debug, PartialEq, Clone, Serialize)]
|
||||
pub AnswerWebAppQuery (AnswerWebAppQuerySetters) => SentWebAppMessage {
|
||||
required {
|
||||
/// Unique identifier for the query to be answered
|
||||
pub web_app_query_id: String [into],
|
||||
/// A JSON-serialized object describing the message to be sent
|
||||
pub result: InlineQueryResult,
|
||||
}
|
||||
}
|
||||
}
|
23
src/payloads/get_chat_menu_button.rs
Normal file
23
src/payloads/get_chat_menu_button.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
// This file is auto generated by [`cg`] from [`schema`].
|
||||
//
|
||||
// **DO NOT EDIT THIS FILE**,
|
||||
//
|
||||
// Edit `cg` or `schema` instead.
|
||||
//
|
||||
// [cg]: https://github.com/teloxide/cg
|
||||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::{ChatId, MenuButton};
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Default, Clone, Serialize)]
|
||||
pub GetChatMenuButton (GetChatMenuButtonSetters) => MenuButton {
|
||||
|
||||
optional {
|
||||
/// Unique identifier for the target private chat. If not specified, default bot's menu button will be returned
|
||||
pub chat_id: ChatId [into],
|
||||
}
|
||||
}
|
||||
}
|
23
src/payloads/get_my_default_administrator_rights.rs
Normal file
23
src/payloads/get_my_default_administrator_rights.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
// This file is auto generated by [`cg`] from [`schema`].
|
||||
//
|
||||
// **DO NOT EDIT THIS FILE**,
|
||||
//
|
||||
// Edit `cg` or `schema` instead.
|
||||
//
|
||||
// [cg]: https://github.com/teloxide/cg
|
||||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::ChatAdministratorRights;
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Default, Clone, Serialize)]
|
||||
pub GetMyDefaultAdministratorRights (GetMyDefaultAdministratorRightsSetters) => ChatAdministratorRights {
|
||||
|
||||
optional {
|
||||
/// Pass _True_ to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned.
|
||||
pub for_channels: bool,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ impl_payload! {
|
|||
/// Pass True, if the administrator can delete messages of other users
|
||||
pub can_delete_messages: bool,
|
||||
/// Pass True, if the administrator can manage voice chats, supergroups only
|
||||
pub can_manage_voice_chats: bool,
|
||||
pub can_manage_video_chats: bool,
|
||||
/// Pass True, if the administrator can invite new users to the chat
|
||||
pub can_invite_users: bool,
|
||||
/// Pass True, if the administrator can restrict, ban or unban chat members
|
||||
|
|
25
src/payloads/set_chat_menu_button.rs
Normal file
25
src/payloads/set_chat_menu_button.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
// This file is auto generated by [`cg`] from [`schema`].
|
||||
//
|
||||
// **DO NOT EDIT THIS FILE**,
|
||||
//
|
||||
// Edit `cg` or `schema` instead.
|
||||
//
|
||||
// [cg]: https://github.com/teloxide/cg
|
||||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::{ChatId, MenuButton, True};
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method to change the bot's menu button in a private chat, or the default menu button.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Default, Clone, Serialize)]
|
||||
pub SetChatMenuButton (SetChatMenuButtonSetters) => True {
|
||||
|
||||
optional {
|
||||
/// Unique identifier for the target private chat. If not specified, default bot's menu button will be changed.
|
||||
pub chat_id: ChatId [into],
|
||||
/// An object for the new bot's menu button. Defaults to MenuButtonDefault
|
||||
pub menu_button: MenuButton,
|
||||
}
|
||||
}
|
||||
}
|
25
src/payloads/set_my_default_administrator_rights.rs
Normal file
25
src/payloads/set_my_default_administrator_rights.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
// This file is auto generated by [`cg`] from [`schema`].
|
||||
//
|
||||
// **DO NOT EDIT THIS FILE**,
|
||||
//
|
||||
// Edit `cg` or `schema` instead.
|
||||
//
|
||||
// [cg]: https://github.com/teloxide/cg
|
||||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::{ChatAdministratorRights, True};
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Default, Clone, Serialize)]
|
||||
pub SetMyDefaultAdministratorRights (SetMyDefaultAdministratorRightsSetters) => True {
|
||||
|
||||
optional {
|
||||
/// A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.
|
||||
pub rights: ChatAdministratorRights,
|
||||
/// Pass _True_ to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.
|
||||
pub for_channels: bool,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,20 +10,22 @@
|
|||
pub use crate::payloads::{
|
||||
AddStickerToSetSetters as _, AnswerCallbackQuerySetters as _, AnswerInlineQuerySetters as _,
|
||||
AnswerPreCheckoutQuerySetters as _, AnswerShippingQuerySetters as _,
|
||||
ApproveChatJoinRequestSetters as _, BanChatMemberSetters as _, BanChatSenderChatSetters as _,
|
||||
CloseSetters as _, CopyMessageSetters as _, CreateChatInviteLinkSetters as _,
|
||||
CreateNewStickerSetSetters as _, DeclineChatJoinRequestSetters as _,
|
||||
DeleteChatPhotoSetters as _, DeleteChatStickerSetSetters as _, DeleteMessageSetters as _,
|
||||
DeleteMyCommandsSetters as _, DeleteStickerFromSetSetters as _, DeleteWebhookSetters as _,
|
||||
EditChatInviteLinkSetters as _, EditMessageCaptionInlineSetters as _,
|
||||
EditMessageCaptionSetters as _, EditMessageLiveLocationInlineSetters as _,
|
||||
EditMessageLiveLocationSetters as _, EditMessageMediaInlineSetters as _,
|
||||
EditMessageMediaSetters as _, EditMessageReplyMarkupInlineSetters as _,
|
||||
EditMessageReplyMarkupSetters as _, EditMessageTextInlineSetters as _,
|
||||
EditMessageTextSetters as _, ExportChatInviteLinkSetters as _, ForwardMessageSetters as _,
|
||||
AnswerWebAppQuerySetters as _, ApproveChatJoinRequestSetters as _, BanChatMemberSetters as _,
|
||||
BanChatSenderChatSetters as _, CloseSetters as _, CopyMessageSetters as _,
|
||||
CreateChatInviteLinkSetters as _, CreateNewStickerSetSetters as _,
|
||||
DeclineChatJoinRequestSetters as _, DeleteChatPhotoSetters as _,
|
||||
DeleteChatStickerSetSetters as _, DeleteMessageSetters as _, DeleteMyCommandsSetters as _,
|
||||
DeleteStickerFromSetSetters as _, DeleteWebhookSetters as _, EditChatInviteLinkSetters as _,
|
||||
EditMessageCaptionInlineSetters as _, EditMessageCaptionSetters as _,
|
||||
EditMessageLiveLocationInlineSetters as _, EditMessageLiveLocationSetters as _,
|
||||
EditMessageMediaInlineSetters as _, EditMessageMediaSetters as _,
|
||||
EditMessageReplyMarkupInlineSetters as _, EditMessageReplyMarkupSetters as _,
|
||||
EditMessageTextInlineSetters as _, EditMessageTextSetters as _,
|
||||
ExportChatInviteLinkSetters as _, ForwardMessageSetters as _,
|
||||
GetChatAdministratorsSetters as _, GetChatMemberCountSetters as _, GetChatMemberSetters as _,
|
||||
GetChatMembersCountSetters as _, GetChatSetters as _, GetFileSetters as _,
|
||||
GetGameHighScoresSetters as _, GetMeSetters as _, GetMyCommandsSetters as _,
|
||||
GetChatMembersCountSetters as _, GetChatMenuButtonSetters as _, GetChatSetters as _,
|
||||
GetFileSetters as _, GetGameHighScoresSetters as _, GetMeSetters as _,
|
||||
GetMyCommandsSetters as _, GetMyDefaultAdministratorRightsSetters as _,
|
||||
GetStickerSetSetters as _, GetUpdatesSetters as _, GetUserProfilePhotosSetters as _,
|
||||
GetWebhookInfoSetters as _, KickChatMemberSetters as _, LeaveChatSetters as _,
|
||||
LogOutSetters as _, PinChatMessageSetters as _, PromoteChatMemberSetters as _,
|
||||
|
@ -34,9 +36,10 @@ pub use crate::payloads::{
|
|||
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 _, SetGameScoreInlineSetters as _, SetGameScoreSetters as _,
|
||||
SetMyCommandsSetters as _, SetPassportDataErrorsSetters as _,
|
||||
SetChatMenuButtonSetters as _, SetChatPermissionsSetters as _, SetChatPhotoSetters as _,
|
||||
SetChatStickerSetSetters as _, SetChatTitleSetters as _, SetGameScoreInlineSetters as _,
|
||||
SetGameScoreSetters as _, SetMyCommandsSetters as _,
|
||||
SetMyDefaultAdministratorRightsSetters as _, SetPassportDataErrorsSetters as _,
|
||||
SetStickerPositionInSetSetters as _, SetStickerSetThumbSetters as _, SetWebhookSetters as _,
|
||||
StopMessageLiveLocationInlineSetters as _, StopMessageLiveLocationSetters as _,
|
||||
StopPollSetters as _, UnbanChatMemberSetters as _, UnbanChatSenderChatSetters as _,
|
||||
|
|
|
@ -590,6 +590,32 @@ pub trait Requester {
|
|||
/// For Telegram documentation see [`GetMyCommands`].
|
||||
fn get_my_commands(&self) -> Self::GetMyCommands;
|
||||
|
||||
type SetChatMenuButton: Request<Payload = SetChatMenuButton, Err = Self::Err>;
|
||||
|
||||
/// For Telegram documentation see [`SetChatMenuButton`].
|
||||
fn set_chat_menu_button(&self) -> Self::SetChatMenuButton;
|
||||
|
||||
type GetChatMenuButton: Request<Payload = GetChatMenuButton, Err = Self::Err>;
|
||||
|
||||
/// For Telegram documentation see [`GetChatMenuButton`].
|
||||
fn get_chat_menu_button(&self) -> Self::GetChatMenuButton;
|
||||
|
||||
type SetMyDefaultAdministratorRights: Request<
|
||||
Payload = SetMyDefaultAdministratorRights,
|
||||
Err = Self::Err,
|
||||
>;
|
||||
|
||||
/// For Telegram documentation see [`SetMyDefaultAdministratorRights`].
|
||||
fn set_my_default_administrator_rights(&self) -> Self::SetMyDefaultAdministratorRights;
|
||||
|
||||
type GetMyDefaultAdministratorRights: Request<
|
||||
Payload = GetMyDefaultAdministratorRights,
|
||||
Err = Self::Err,
|
||||
>;
|
||||
|
||||
/// For Telegram documentation see [`GetMyDefaultAdministratorRights`].
|
||||
fn get_my_default_administrator_rights(&self) -> Self::GetMyDefaultAdministratorRights;
|
||||
|
||||
type DeleteMyCommands: Request<Payload = DeleteMyCommands, Err = Self::Err>;
|
||||
|
||||
/// For Telegram documentation see [`DeleteMyCommands`].
|
||||
|
@ -603,6 +629,17 @@ pub trait Requester {
|
|||
I: Into<String>,
|
||||
R: IntoIterator<Item = InlineQueryResult>;
|
||||
|
||||
type AnswerWebAppQuery: Request<Payload = AnswerWebAppQuery, Err = Self::Err>;
|
||||
|
||||
/// For Telegram documentation see [`AnswerWebAppQuery`].
|
||||
fn answer_web_app_query<W>(
|
||||
&self,
|
||||
web_app_query_id: W,
|
||||
result: InlineQueryResult,
|
||||
) -> Self::AnswerWebAppQuery
|
||||
where
|
||||
W: Into<String>;
|
||||
|
||||
type EditMessageText: Request<Payload = EditMessageText, Err = Self::Err>;
|
||||
|
||||
/// For Telegram documentation see [`EditMessageText`].
|
||||
|
@ -902,7 +939,7 @@ macro_rules! forward_all {
|
|||
set_chat_description, pin_chat_message, unpin_chat_message, unpin_all_chat_messages,
|
||||
leave_chat, get_chat, get_chat_administrators, get_chat_members_count, get_chat_member_count, get_chat_member,
|
||||
set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query,
|
||||
set_my_commands, get_my_commands, delete_my_commands, answer_inline_query, edit_message_text,
|
||||
set_my_commands, get_my_commands, set_chat_menu_button, get_chat_menu_button, set_my_default_administrator_rights, get_my_default_administrator_rights, delete_my_commands, answer_inline_query, answer_web_app_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,
|
||||
|
@ -998,7 +1035,7 @@ where
|
|||
set_chat_description, pin_chat_message, unpin_chat_message, unpin_all_chat_messages,
|
||||
leave_chat, get_chat, get_chat_administrators, get_chat_members_count, get_chat_member_count, get_chat_member,
|
||||
set_chat_sticker_set, delete_chat_sticker_set, answer_callback_query,
|
||||
set_my_commands, get_my_commands, delete_my_commands, answer_inline_query, edit_message_text,
|
||||
set_my_commands, get_my_commands, set_chat_menu_button, get_chat_menu_button, set_my_default_administrator_rights, get_my_default_administrator_rights, delete_my_commands, answer_inline_query, answer_web_app_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,
|
||||
|
|
Loading…
Reference in a new issue