TBA 6.4 methods

This commit is contained in:
Maybe Waffle 2023-01-14 20:01:54 +04:00
parent e86184fcd0
commit f624b9a996
23 changed files with 467 additions and 50 deletions

View file

@ -469,6 +469,11 @@ Schema(
ty: Option(ArrayOf(RawTy("MessageEntity"))),
descr: Doc(md: "List of special entities that appear in the photo caption, which can be specified instead of _parse\\_mode_"),
),
Param(
name: "has_spoiler",
ty: Option(bool),
descr: Doc(md: "Pass True if the photo needs to be covered with a spoiler animation"),
),
Param(
name: "disable_notification",
ty: Option(bool),
@ -780,6 +785,11 @@ Schema(
ty: Option(ArrayOf(RawTy("MessageEntity"))),
descr: Doc(md: "List of special entities that appear in the caption, which can be specified instead of _parse\\_mode_"),
),
Param(
name: "has_spoiler",
ty: Option(bool),
descr: Doc(md: "Pass True if the video needs to be covered with a spoiler animation"),
),
Param(
name: "supports_streaming",
ty: Option(bool),
@ -891,6 +901,11 @@ Schema(
ty: Option(ArrayOf(RawTy("MessageEntity"))),
descr: Doc(md: "List of special entities that appear in the photo caption, which can be specified instead of _parse\\_mode_"),
),
Param(
name: "has_spoiler",
ty: Option(bool),
descr: Doc(md: "Pass True if the animation needs to be covered with a spoiler animation"),
),
Param(
name: "disable_notification",
ty: Option(bool),
@ -1827,6 +1842,11 @@ Schema(
}
),
),
Param(
name: "message_thread_id",
ty: Option(i32),
descr: Doc(md: "Unique identifier for the target message thread; supergroups only")
),
],
),
Method(
@ -2631,13 +2651,13 @@ Schema(
),
Param(
name: "name",
ty: String,
descr: Doc(md: "Topic name, 1-128 characters")
ty: Option(String),
descr: Doc(md: "Topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept")
),
Param(
name: "icon_custom_emoji_id",
ty: String,
descr: Doc(md: "Unique identifier of the custom emoji shown as the topic icon. Use `getForumTopicIconStickers` to get all allowed custom emoji identifiers.")
ty: Option(String),
descr: Doc(md: "Unique identifier of the custom emoji shown as the topic icon. Use `getForumTopicIconStickers` to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept")
),
],
),
@ -2717,6 +2737,81 @@ Schema(
),
],
),
Method(
names: ("editGeneralForumTopic", "EditGeneralForumTopic", "edit_general_forum_topic"),
return_ty: True,
doc: Doc(md: "Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have _can\\_manage\\_topics_ administrator rights. Returns True on success."),
tg_doc: "https://core.telegram.org/bots/api#editgeneralforumtopic",
tg_category: "Available methods",
params: [
Param(
name: "chat_id",
ty: RawTy("Recipient"),
descr: Doc(md: "Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)")
),
Param(
name: "name",
ty: String,
descr: Doc(md: "New topic name, 1-128 characters"),
),
],
),
Method(
names: ("closeGeneralForumTopic", "CloseGeneralForumTopic", "close_general_forum_topic"),
return_ty: True,
doc: Doc(md: "Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\\_manage\\_topics_ administrator rights. Returns True on success."),
tg_doc: "https://core.telegram.org/bots/api#closegeneralforumtopic",
tg_category: "Available methods",
params: [
Param(
name: "chat_id",
ty: RawTy("Recipient"),
descr: Doc(md: "Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)")
),
],
),
Method(
names: ("reopenGeneralForumTopic", "ReopenGeneralForumTopic", "reopen_general_forum_topic"),
return_ty: True,
doc: Doc(md: "Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\\_manage\\_topics_ administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success."),
tg_doc: "https://core.telegram.org/bots/api#reopengeneralforumtopic",
tg_category: "Available methods",
params: [
Param(
name: "chat_id",
ty: RawTy("Recipient"),
descr: Doc(md: "Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)")
),
],
),
Method(
names: ("hideGeneralForumTopic", "HideGeneralForumTopic", "hide_general_forum_topic"),
return_ty: True,
doc: Doc(md: "Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\\_manage\\_topics_ administrator rights. The topic will be automatically closed if it was open. Returns True on success."),
tg_doc: "https://core.telegram.org/bots/api#hidegeneralforumtopic",
tg_category: "Available methods",
params: [
Param(
name: "chat_id",
ty: RawTy("Recipient"),
descr: Doc(md: "Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)")
),
],
),
Method(
names: ("unhideGeneralForumTopic", "UnhideGeneralForumTopic", "unhide_general_forum_topic"),
return_ty: True,
doc: Doc(md: "Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\\_manage\\_topics_ administrator rights. Returns True on success."),
tg_doc: "https://core.telegram.org/bots/api#unhidegeneralforumtopic",
tg_category: "Available methods",
params: [
Param(
name: "chat_id",
ty: RawTy("Recipient"),
descr: Doc(md: "Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)")
),
],
),
Method(
names: ("answerCallbackQuery", "AnswerCallbackQuery", "answer_callback_query"),
return_ty: True,

View file

@ -127,6 +127,11 @@ where
reopen_forum_topic,
delete_forum_topic,
unpin_all_forum_topic_messages,
edit_general_forum_topic,
close_general_forum_topic,
reopen_general_forum_topic,
hide_general_forum_topic,
unhide_general_forum_topic,
answer_callback_query,
set_my_commands,
get_my_commands,

View file

@ -151,6 +151,11 @@ where
reopen_forum_topic,
delete_forum_topic,
unpin_all_forum_topic_messages,
edit_general_forum_topic,
close_general_forum_topic,
reopen_general_forum_topic,
hide_general_forum_topic,
unhide_general_forum_topic,
answer_callback_query,
set_my_commands,
get_my_commands,

View file

@ -240,6 +240,11 @@ where
reopen_forum_topic,
delete_forum_topic,
unpin_all_forum_topic_messages,
edit_general_forum_topic,
close_general_forum_topic,
reopen_general_forum_topic,
hide_general_forum_topic,
unhide_general_forum_topic,
answer_callback_query,
set_my_commands,
get_my_commands,
@ -628,8 +633,6 @@ trait ErasableRequester<'a> {
&self,
chat_id: Recipient,
message_thread_id: i32,
name: String,
icon_custom_emoji_id: String,
) -> ErasedRequest<'a, EditForumTopic, Self::Err>;
fn close_forum_topic(
@ -656,6 +659,32 @@ trait ErasableRequester<'a> {
message_thread_id: i32,
) -> ErasedRequest<'a, UnpinAllForumTopicMessages, Self::Err>;
fn edit_general_forum_topic(
&self,
chat_id: Recipient,
name: String,
) -> ErasedRequest<'a, EditGeneralForumTopic, Self::Err>;
fn close_general_forum_topic(
&self,
chat_id: Recipient,
) -> ErasedRequest<'a, CloseGeneralForumTopic, Self::Err>;
fn reopen_general_forum_topic(
&self,
chat_id: Recipient,
) -> ErasedRequest<'a, ReopenGeneralForumTopic, Self::Err>;
fn hide_general_forum_topic(
&self,
chat_id: Recipient,
) -> ErasedRequest<'a, HideGeneralForumTopic, Self::Err>;
fn unhide_general_forum_topic(
&self,
chat_id: Recipient,
) -> ErasedRequest<'a, UnhideGeneralForumTopic, Self::Err>;
fn answer_callback_query(
&self,
callback_query_id: String,
@ -1350,11 +1379,8 @@ where
&self,
chat_id: Recipient,
message_thread_id: i32,
name: String,
icon_custom_emoji_id: String,
) -> ErasedRequest<'a, EditForumTopic, Self::Err> {
Requester::edit_forum_topic(self, chat_id, message_thread_id, name, icon_custom_emoji_id)
.erase()
Requester::edit_forum_topic(self, chat_id, message_thread_id).erase()
}
fn close_forum_topic(
@ -1389,6 +1415,42 @@ where
Requester::unpin_all_forum_topic_messages(self, chat_id, message_thread_id).erase()
}
fn edit_general_forum_topic(
&self,
chat_id: Recipient,
name: String,
) -> ErasedRequest<'a, EditGeneralForumTopic, Self::Err> {
Requester::edit_general_forum_topic(self, chat_id, name).erase()
}
fn close_general_forum_topic(
&self,
chat_id: Recipient,
) -> ErasedRequest<'a, CloseGeneralForumTopic, Self::Err> {
Requester::close_general_forum_topic(self, chat_id).erase()
}
fn reopen_general_forum_topic(
&self,
chat_id: Recipient,
) -> ErasedRequest<'a, ReopenGeneralForumTopic, Self::Err> {
Requester::reopen_general_forum_topic(self, chat_id).erase()
}
fn hide_general_forum_topic(
&self,
chat_id: Recipient,
) -> ErasedRequest<'a, HideGeneralForumTopic, Self::Err> {
Requester::hide_general_forum_topic(self, chat_id).erase()
}
fn unhide_general_forum_topic(
&self,
chat_id: Recipient,
) -> ErasedRequest<'a, UnhideGeneralForumTopic, Self::Err> {
Requester::unhide_general_forum_topic(self, chat_id).erase()
}
fn answer_callback_query(
&self,
callback_query_id: String,

View file

@ -149,6 +149,11 @@ impl<B: Requester> Requester for DefaultParseMode<B> {
close_forum_topic,
reopen_forum_topic,
delete_forum_topic,
edit_general_forum_topic,
close_general_forum_topic,
reopen_general_forum_topic,
hide_general_forum_topic,
unhide_general_forum_topic,
unpin_all_forum_topic_messages,
answer_callback_query,
set_my_commands,

View file

@ -134,6 +134,11 @@ where
reopen_forum_topic,
delete_forum_topic,
unpin_all_forum_topic_messages,
edit_general_forum_topic,
close_general_forum_topic,
reopen_general_forum_topic,
hide_general_forum_topic,
unhide_general_forum_topic,
answer_callback_query,
set_my_commands,
get_my_commands,

View file

@ -180,6 +180,11 @@ where
reopen_forum_topic,
delete_forum_topic,
unpin_all_forum_topic_messages,
edit_general_forum_topic,
close_general_forum_topic,
reopen_general_forum_topic,
hide_general_forum_topic,
unhide_general_forum_topic,
answer_callback_query,
set_my_commands,
get_my_commands,

View file

@ -675,21 +675,13 @@ impl Requester for Bot {
type EditForumTopic = JsonRequest<payloads::EditForumTopic>;
fn edit_forum_topic<C, N, I>(
&self,
chat_id: C,
message_thread_id: i32,
name: N,
icon_custom_emoji_id: I,
) -> Self::EditForumTopic
fn edit_forum_topic<C>(&self, chat_id: C, message_thread_id: i32) -> Self::EditForumTopic
where
C: Into<Recipient>,
N: Into<String>,
I: Into<String>,
{
Self::EditForumTopic::new(
self.clone(),
payloads::EditForumTopic::new(chat_id, message_thread_id, name, icon_custom_emoji_id),
payloads::EditForumTopic::new(chat_id, message_thread_id),
)
}
@ -745,6 +737,71 @@ impl Requester for Bot {
)
}
type EditGeneralForumTopic = JsonRequest<payloads::EditGeneralForumTopic>;
fn edit_general_forum_topic<C, N>(&self, chat_id: C, name: N) -> Self::EditGeneralForumTopic
where
C: Into<Recipient>,
N: Into<String>,
{
Self::EditGeneralForumTopic::new(
self.clone(),
payloads::EditGeneralForumTopic::new(chat_id, name),
)
}
type CloseGeneralForumTopic = JsonRequest<payloads::CloseGeneralForumTopic>;
/// For Telegram documentation see [`CloseGeneralForumTopic`].
fn close_general_forum_topic<C>(&self, chat_id: C) -> Self::CloseGeneralForumTopic
where
C: Into<Recipient>,
{
Self::CloseGeneralForumTopic::new(
self.clone(),
payloads::CloseGeneralForumTopic::new(chat_id),
)
}
type ReopenGeneralForumTopic = JsonRequest<payloads::ReopenGeneralForumTopic>;
/// For Telegram documentation see [`ReopenGeneralForumTopic`].
fn reopen_general_forum_topic<C>(&self, chat_id: C) -> Self::ReopenGeneralForumTopic
where
C: Into<Recipient>,
{
Self::ReopenGeneralForumTopic::new(
self.clone(),
payloads::ReopenGeneralForumTopic::new(chat_id),
)
}
type HideGeneralForumTopic = JsonRequest<payloads::HideGeneralForumTopic>;
/// For Telegram documentation see [`HideGeneralForumTopic`].
fn hide_general_forum_topic<C>(&self, chat_id: C) -> Self::HideGeneralForumTopic
where
C: Into<Recipient>,
{
Self::HideGeneralForumTopic::new(
self.clone(),
payloads::HideGeneralForumTopic::new(chat_id),
)
}
type UnhideGeneralForumTopic = JsonRequest<payloads::UnhideGeneralForumTopic>;
/// For Telegram documentation see [`UnhideGeneralForumTopic`].
fn unhide_general_forum_topic<C>(&self, chat_id: C) -> Self::UnhideGeneralForumTopic
where
C: Into<Recipient>,
{
Self::UnhideGeneralForumTopic::new(
self.clone(),
payloads::UnhideGeneralForumTopic::new(chat_id),
)
}
type AnswerCallbackQuery = JsonRequest<payloads::AnswerCallbackQuery>;
fn answer_callback_query<C>(&self, callback_query_id: C) -> Self::AnswerCallbackQuery

View file

@ -931,11 +931,9 @@ macro_rules! requester_forward {
(@method edit_forum_topic $body:ident $ty:ident) => {
type EditForumTopic = $ty![EditForumTopic];
fn edit_forum_topic<C, N, I>(&self, chat_id: C, message_thread_id: i32, name: N, icon_custom_emoji_id: I) -> Self::EditForumTopic where C: Into<Recipient>,
N: Into<String>,
I: Into<String> {
fn edit_forum_topic<C>(&self, chat_id: C, message_thread_id: i32) -> Self::EditForumTopic where C: Into<Recipient> {
let this = self;
$body!(edit_forum_topic this (chat_id: C, message_thread_id: i32, name: N, icon_custom_emoji_id: I))
$body!(edit_forum_topic this (chat_id: C, message_thread_id: i32))
}
};
(@method close_forum_topic $body:ident $ty:ident) => {
@ -970,6 +968,47 @@ macro_rules! requester_forward {
$body!(unpin_all_forum_topic_messages this (chat_id: C, message_thread_id: i32))
}
};
(@method edit_general_forum_topic $body:ident $ty:ident) => {
type EditGeneralForumTopic = $ty![EditGeneralForumTopic];
fn edit_general_forum_topic<C, N>(&self, chat_id: C, name: N) -> Self::EditGeneralForumTopic where C: Into<Recipient>,
N: Into<String> {
let this = self;
$body!(edit_general_forum_topic this (chat_id: C, name: N))
}
};
(@method close_general_forum_topic $body:ident $ty:ident) => {
type CloseGeneralForumTopic = $ty![CloseGeneralForumTopic];
fn close_general_forum_topic<C>(&self, chat_id: C) -> Self::CloseGeneralForumTopic where C: Into<Recipient> {
let this = self;
$body!(close_general_forum_topic this (chat_id: C))
}
};
(@method reopen_general_forum_topic $body:ident $ty:ident) => {
type ReopenGeneralForumTopic = $ty![ReopenGeneralForumTopic];
fn reopen_general_forum_topic<C>(&self, chat_id: C) -> Self::ReopenGeneralForumTopic where C: Into<Recipient> {
let this = self;
$body!(reopen_general_forum_topic this (chat_id: C))
}
};
(@method hide_general_forum_topic $body:ident $ty:ident) => {
type HideGeneralForumTopic = $ty![HideGeneralForumTopic];
fn hide_general_forum_topic<C>(&self, chat_id: C) -> Self::HideGeneralForumTopic where C: Into<Recipient> {
let this = self;
$body!(hide_general_forum_topic this (chat_id: C))
}
};
(@method unhide_general_forum_topic $body:ident $ty:ident) => {
type UnhideGeneralForumTopic = $ty![UnhideGeneralForumTopic];
fn unhide_general_forum_topic<C>(&self, chat_id: C) -> Self::UnhideGeneralForumTopic where C: Into<Recipient> {
let this = self;
$body!(unhide_general_forum_topic this (chat_id: C))
}
};
(@method answer_callback_query $body:ident $ty:ident) => {
type AnswerCallbackQuery = $ty![AnswerCallbackQuery];

View file

@ -26,6 +26,7 @@ mod ban_chat_member;
mod ban_chat_sender_chat;
mod close;
mod close_forum_topic;
mod close_general_forum_topic;
mod copy_message;
mod create_chat_invite_link;
mod create_forum_topic;
@ -41,6 +42,7 @@ mod delete_sticker_from_set;
mod delete_webhook;
mod edit_chat_invite_link;
mod edit_forum_topic;
mod edit_general_forum_topic;
mod edit_message_caption;
mod edit_message_caption_inline;
mod edit_message_live_location;
@ -70,12 +72,14 @@ mod get_sticker_set;
mod get_updates;
mod get_user_profile_photos;
mod get_webhook_info;
mod hide_general_forum_topic;
mod kick_chat_member;
mod leave_chat;
mod log_out;
mod pin_chat_message;
mod promote_chat_member;
mod reopen_forum_topic;
mod reopen_general_forum_topic;
mod restrict_chat_member;
mod revoke_chat_invite_link;
mod send_animation;
@ -116,6 +120,7 @@ mod stop_message_live_location_inline;
mod stop_poll;
mod unban_chat_member;
mod unban_chat_sender_chat;
mod unhide_general_forum_topic;
mod unpin_all_chat_messages;
mod unpin_all_forum_topic_messages;
mod unpin_chat_message;
@ -132,6 +137,7 @@ pub use ban_chat_member::{BanChatMember, BanChatMemberSetters};
pub use ban_chat_sender_chat::{BanChatSenderChat, BanChatSenderChatSetters};
pub use close::{Close, CloseSetters};
pub use close_forum_topic::{CloseForumTopic, CloseForumTopicSetters};
pub use close_general_forum_topic::{CloseGeneralForumTopic, CloseGeneralForumTopicSetters};
pub use copy_message::{CopyMessage, CopyMessageSetters};
pub use create_chat_invite_link::{CreateChatInviteLink, CreateChatInviteLinkSetters};
pub use create_forum_topic::{CreateForumTopic, CreateForumTopicSetters};
@ -147,6 +153,7 @@ pub use delete_sticker_from_set::{DeleteStickerFromSet, DeleteStickerFromSetSett
pub use delete_webhook::{DeleteWebhook, DeleteWebhookSetters};
pub use edit_chat_invite_link::{EditChatInviteLink, EditChatInviteLinkSetters};
pub use edit_forum_topic::{EditForumTopic, EditForumTopicSetters};
pub use edit_general_forum_topic::{EditGeneralForumTopic, EditGeneralForumTopicSetters};
pub use edit_message_caption::{EditMessageCaption, EditMessageCaptionSetters};
pub use edit_message_caption_inline::{EditMessageCaptionInline, EditMessageCaptionInlineSetters};
pub use edit_message_live_location::{EditMessageLiveLocation, EditMessageLiveLocationSetters};
@ -184,12 +191,14 @@ pub use get_sticker_set::{GetStickerSet, GetStickerSetSetters};
pub use get_updates::{GetUpdates, GetUpdatesSetters};
pub use get_user_profile_photos::{GetUserProfilePhotos, GetUserProfilePhotosSetters};
pub use get_webhook_info::{GetWebhookInfo, GetWebhookInfoSetters};
pub use hide_general_forum_topic::{HideGeneralForumTopic, HideGeneralForumTopicSetters};
pub use kick_chat_member::{KickChatMember, KickChatMemberSetters};
pub use leave_chat::{LeaveChat, LeaveChatSetters};
pub use log_out::{LogOut, LogOutSetters};
pub use pin_chat_message::{PinChatMessage, PinChatMessageSetters};
pub use promote_chat_member::{PromoteChatMember, PromoteChatMemberSetters};
pub use reopen_forum_topic::{ReopenForumTopic, ReopenForumTopicSetters};
pub use reopen_general_forum_topic::{ReopenGeneralForumTopic, ReopenGeneralForumTopicSetters};
pub use restrict_chat_member::{RestrictChatMember, RestrictChatMemberSetters};
pub use revoke_chat_invite_link::{RevokeChatInviteLink, RevokeChatInviteLinkSetters};
pub use send_animation::{SendAnimation, SendAnimationSetters};
@ -236,6 +245,7 @@ pub use stop_message_live_location_inline::{
pub use stop_poll::{StopPoll, StopPollSetters};
pub use unban_chat_member::{UnbanChatMember, UnbanChatMemberSetters};
pub use unban_chat_sender_chat::{UnbanChatSenderChat, UnbanChatSenderChatSetters};
pub use unhide_general_forum_topic::{UnhideGeneralForumTopic, UnhideGeneralForumTopicSetters};
pub use unpin_all_chat_messages::{UnpinAllChatMessages, UnpinAllChatMessagesSetters};
pub use unpin_all_forum_topic_messages::{
UnpinAllForumTopicMessages, UnpinAllForumTopicMessagesSetters,

View file

@ -0,0 +1,16 @@
//! Generated by `codegen_payloads`, do not edit by hand.
use serde::Serialize;
use crate::types::{Recipient, True};
impl_payload! {
/// Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\_manage\_topics_ administrator rights. Returns True on success.
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
pub CloseGeneralForumTopic (CloseGeneralForumTopicSetters) => True {
required {
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
pub chat_id: Recipient [into],
}
}
}

View file

@ -13,9 +13,11 @@ impl_payload! {
pub chat_id: Recipient [into],
/// Unique identifier for the target message thread of the forum topic
pub message_thread_id: i32,
/// Topic name, 1-128 characters
}
optional {
/// Topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept
pub name: String [into],
/// Unique identifier of the custom emoji shown as the topic icon. Use `getForumTopicIconStickers` to get all allowed custom emoji identifiers.
/// Unique identifier of the custom emoji shown as the topic icon. Use `getForumTopicIconStickers` to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept
pub icon_custom_emoji_id: String [into],
}
}

View file

@ -0,0 +1,18 @@
//! Generated by `codegen_payloads`, do not edit by hand.
use serde::Serialize;
use crate::types::{Recipient, True};
impl_payload! {
/// Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have _can\_manage\_topics_ administrator rights. Returns True on success.
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
pub EditGeneralForumTopic (EditGeneralForumTopicSetters) => True {
required {
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
pub chat_id: Recipient [into],
/// New topic name, 1-128 characters
pub name: String [into],
}
}
}

View file

@ -0,0 +1,16 @@
//! Generated by `codegen_payloads`, do not edit by hand.
use serde::Serialize;
use crate::types::{Recipient, True};
impl_payload! {
/// Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\_manage\_topics_ administrator rights. The topic will be automatically closed if it was open. Returns True on success.
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
pub HideGeneralForumTopic (HideGeneralForumTopicSetters) => True {
required {
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
pub chat_id: Recipient [into],
}
}
}

View file

@ -0,0 +1,16 @@
//! Generated by `codegen_payloads`, do not edit by hand.
use serde::Serialize;
use crate::types::{Recipient, True};
impl_payload! {
/// Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\_manage\_topics_ administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
pub ReopenGeneralForumTopic (ReopenGeneralForumTopicSetters) => True {
required {
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
pub chat_id: Recipient [into],
}
}
}

View file

@ -42,6 +42,8 @@ impl_payload! {
pub parse_mode: ParseMode,
/// List of special entities that appear in the photo caption, which can be specified instead of _parse\_mode_
pub caption_entities: Vec<MessageEntity> [collect],
/// Pass True if the animation needs to be covered with a spoiler animation
pub has_spoiler: bool,
/// Sends the message [silently]. Users will receive a notification with no sound.
///
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages

View file

@ -29,5 +29,9 @@ impl_payload! {
/// [video notes]: crate::payloads::SendVideoNote
pub action: ChatAction,
}
optional {
/// Unique identifier for the target message thread; supergroups only
pub message_thread_id: i32,
}
}
}

View file

@ -32,6 +32,8 @@ impl_payload! {
pub parse_mode: ParseMode,
/// List of special entities that appear in the photo caption, which can be specified instead of _parse\_mode_
pub caption_entities: Vec<MessageEntity> [collect],
/// Pass True if the photo needs to be covered with a spoiler animation
pub has_spoiler: bool,
/// Sends the message [silently]. Users will receive a notification with no sound.
///
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages

View file

@ -43,6 +43,8 @@ impl_payload! {
pub parse_mode: ParseMode,
/// List of special entities that appear in the caption, which can be specified instead of _parse\_mode_
pub caption_entities: Vec<MessageEntity> [collect],
/// Pass True if the video needs to be covered with a spoiler animation
pub has_spoiler: bool,
/// Pass _True_, if the uploaded video is suitable for streaming
pub supports_streaming: bool,
/// Sends the message [silently]. Users will receive a notification with no sound.

View file

@ -5,13 +5,13 @@ pub use crate::payloads::{
AddStickerToSetSetters as _, AnswerCallbackQuerySetters as _, AnswerInlineQuerySetters as _,
AnswerPreCheckoutQuerySetters as _, AnswerShippingQuerySetters as _,
AnswerWebAppQuerySetters as _, ApproveChatJoinRequestSetters as _, BanChatMemberSetters as _,
BanChatSenderChatSetters as _, CloseForumTopicSetters as _, CloseSetters as _,
CopyMessageSetters as _, CreateChatInviteLinkSetters as _, CreateForumTopicSetters as _,
CreateInvoiceLinkSetters as _, CreateNewStickerSetSetters as _,
BanChatSenderChatSetters as _, CloseForumTopicSetters as _, CloseGeneralForumTopicSetters as _,
CloseSetters as _, CopyMessageSetters as _, CreateChatInviteLinkSetters as _,
CreateForumTopicSetters as _, CreateInvoiceLinkSetters as _, CreateNewStickerSetSetters as _,
DeclineChatJoinRequestSetters as _, DeleteChatPhotoSetters as _,
DeleteChatStickerSetSetters as _, DeleteForumTopicSetters as _, DeleteMessageSetters as _,
DeleteMyCommandsSetters as _, DeleteStickerFromSetSetters as _, DeleteWebhookSetters as _,
EditChatInviteLinkSetters as _, EditForumTopicSetters as _,
EditChatInviteLinkSetters as _, EditForumTopicSetters as _, EditGeneralForumTopicSetters as _,
EditMessageCaptionInlineSetters as _, EditMessageCaptionSetters as _,
EditMessageLiveLocationInlineSetters as _, EditMessageLiveLocationSetters as _,
EditMessageMediaInlineSetters as _, EditMessageMediaSetters as _,
@ -23,12 +23,13 @@ pub use crate::payloads::{
GetCustomEmojiStickersSetters as _, GetFileSetters as _, GetForumTopicIconStickersSetters 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 _, ReopenForumTopicSetters as _, RestrictChatMemberSetters as _,
RevokeChatInviteLinkSetters as _, SendAnimationSetters as _, SendAudioSetters as _,
SendChatActionSetters as _, SendContactSetters as _, SendDiceSetters as _,
SendDocumentSetters as _, SendGameSetters as _, SendInvoiceSetters as _,
GetUserProfilePhotosSetters as _, GetWebhookInfoSetters as _,
HideGeneralForumTopicSetters as _, KickChatMemberSetters as _, LeaveChatSetters as _,
LogOutSetters as _, PinChatMessageSetters as _, PromoteChatMemberSetters as _,
ReopenForumTopicSetters as _, ReopenGeneralForumTopicSetters as _,
RestrictChatMemberSetters as _, RevokeChatInviteLinkSetters 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 _,
@ -40,6 +41,7 @@ pub use crate::payloads::{
SetStickerPositionInSetSetters as _, SetStickerSetThumbSetters as _, SetWebhookSetters as _,
StopMessageLiveLocationInlineSetters as _, StopMessageLiveLocationSetters as _,
StopPollSetters as _, UnbanChatMemberSetters as _, UnbanChatSenderChatSetters as _,
UnpinAllChatMessagesSetters as _, UnpinAllForumTopicMessagesSetters as _,
UnpinChatMessageSetters as _, UploadStickerFileSetters as _,
UnhideGeneralForumTopicSetters as _, UnpinAllChatMessagesSetters as _,
UnpinAllForumTopicMessagesSetters as _, UnpinChatMessageSetters as _,
UploadStickerFileSetters as _,
};

View file

@ -0,0 +1,16 @@
//! Generated by `codegen_payloads`, do not edit by hand.
use serde::Serialize;
use crate::types::{Recipient, True};
impl_payload! {
/// Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\_manage\_topics_ administrator rights. Returns True on success.
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
pub UnhideGeneralForumTopic (UnhideGeneralForumTopicSetters) => True {
required {
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
pub chat_id: Recipient [into],
}
}
}

View file

@ -682,17 +682,9 @@ pub trait Requester {
type EditForumTopic: Request<Payload = EditForumTopic, Err = Self::Err>;
/// For Telegram documentation see [`EditForumTopic`].
fn edit_forum_topic<C, N, I>(
&self,
chat_id: C,
message_thread_id: i32,
name: N,
icon_custom_emoji_id: I,
) -> Self::EditForumTopic
fn edit_forum_topic<C>(&self, chat_id: C, message_thread_id: i32) -> Self::EditForumTopic
where
C: Into<Recipient>,
N: Into<String>,
I: Into<String>;
C: Into<Recipient>;
type CloseForumTopic: Request<Payload = CloseForumTopic, Err = Self::Err>;
@ -726,6 +718,42 @@ pub trait Requester {
where
C: Into<Recipient>;
type EditGeneralForumTopic: Request<Payload = EditGeneralForumTopic, Err = Self::Err>;
/// For Telegram documentation see [`EditGeneralForumTopic`].
fn edit_general_forum_topic<C, N>(&self, chat_id: C, name: N) -> Self::EditGeneralForumTopic
where
C: Into<Recipient>,
N: Into<String>;
type CloseGeneralForumTopic: Request<Payload = CloseGeneralForumTopic, Err = Self::Err>;
/// For Telegram documentation see [`CloseGeneralForumTopic`].
fn close_general_forum_topic<C>(&self, chat_id: C) -> Self::CloseGeneralForumTopic
where
C: Into<Recipient>;
type ReopenGeneralForumTopic: Request<Payload = ReopenGeneralForumTopic, Err = Self::Err>;
/// For Telegram documentation see [`ReopenGeneralForumTopic`].
fn reopen_general_forum_topic<C>(&self, chat_id: C) -> Self::ReopenGeneralForumTopic
where
C: Into<Recipient>;
type HideGeneralForumTopic: Request<Payload = HideGeneralForumTopic, Err = Self::Err>;
/// For Telegram documentation see [`HideGeneralForumTopic`].
fn hide_general_forum_topic<C>(&self, chat_id: C) -> Self::HideGeneralForumTopic
where
C: Into<Recipient>;
type UnhideGeneralForumTopic: Request<Payload = UnhideGeneralForumTopic, Err = Self::Err>;
/// For Telegram documentation see [`UnhideGeneralForumTopic`].
fn unhide_general_forum_topic<C>(&self, chat_id: C) -> Self::UnhideGeneralForumTopic
where
C: Into<Recipient>;
type AnswerCallbackQuery: Request<Payload = AnswerCallbackQuery, Err = Self::Err>;
/// For Telegram documentation see [`AnswerCallbackQuery`].
@ -1177,6 +1205,11 @@ macro_rules! forward_all {
reopen_forum_topic,
delete_forum_topic,
unpin_all_forum_topic_messages,
edit_general_forum_topic,
close_general_forum_topic,
reopen_general_forum_topic,
hide_general_forum_topic,
unhide_general_forum_topic,
answer_callback_query,
set_my_commands,
get_my_commands,