Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot API 8.0 - Media Sharing and File Downloads #236

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/api_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,16 @@ pub struct AnswerWebAppQueryParams {
pub result: InlineQueryResult,
}

#[apply(apistruct!)]
pub struct SavePreparedInlineMessageParams {
pub user_id: u64,
pub result: InlineQueryResult,
pub allow_user_chats: Option<bool>,
pub allow_bot_chats: Option<bool>,
pub allow_group_chats: Option<bool>,
pub allow_channel_chats: Option<bool>,
}

#[apply(apistruct!)]
#[derive(Eq)]
pub struct SetChatMenuButtonParams {
Expand Down
7 changes: 7 additions & 0 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,13 @@ pub struct ChosenInlineResult {
pub query: String,
}

#[apply(apistruct!)]
#[derive(Eq)]
pub struct PreparedInlineMessage {
pub id: String,
pub expiration_date: u64,
}

#[apply(apistruct!)]
#[derive(Eq)]
pub struct LabeledPrice {
Expand Down
5 changes: 3 additions & 2 deletions src/trait_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use crate::objects::{
BotCommand, BotDescription, BotName, BotShortDescription, BusinessConnection,
ChatAdministratorRights, ChatFullInfo, ChatInviteLink, ChatMember, File as FileObject,
ForumTopic, GameHighScore, InputSticker, MenuButton, Message, MessageId, Poll,
SentWebAppMessage, StarTransactions, Sticker, StickerSet, Update, User, UserChatBoosts,
UserProfilePhotos, WebhookInfo,
PreparedInlineMessage, SentWebAppMessage, StarTransactions, Sticker, StickerSet, Update, User,
UserChatBoosts, UserProfilePhotos, WebhookInfo,
};
use crate::response::{MessageOrBool, MethodResponse};

Expand Down Expand Up @@ -639,6 +639,7 @@ where
request!(setMyDefaultAdministratorRights, bool);
request!(getMyDefaultAdministratorRights, ChatAdministratorRights);
request!(answerWebAppQuery, SentWebAppMessage);
request!(savePreparedInlineMessage, PreparedInlineMessage);
request!(setChatMenuButton, bool);
request!(getChatMenuButton, MenuButton);
request!(unpinAllGeneralForumTopicMessages, bool);
Expand Down
5 changes: 3 additions & 2 deletions src/trait_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use crate::objects::{
BotCommand, BotDescription, BotName, BotShortDescription, BusinessConnection,
ChatAdministratorRights, ChatFullInfo, ChatInviteLink, ChatMember, File as FileObject,
ForumTopic, GameHighScore, InputSticker, MenuButton, Message, MessageId, Poll,
SentWebAppMessage, StarTransactions, Sticker, StickerSet, Update, User, UserChatBoosts,
UserProfilePhotos, WebhookInfo,
PreparedInlineMessage, SentWebAppMessage, StarTransactions, Sticker, StickerSet, Update, User,
UserChatBoosts, UserProfilePhotos, WebhookInfo,
};
use crate::response::{MessageOrBool, MethodResponse};

Expand Down Expand Up @@ -605,6 +605,7 @@ pub trait TelegramApi {
request!(setMyDefaultAdministratorRights, bool);
request!(getMyDefaultAdministratorRights, ChatAdministratorRights);
request!(answerWebAppQuery, SentWebAppMessage);
request!(savePreparedInlineMessage, PreparedInlineMessage);
request!(setChatMenuButton, bool);
request!(getChatMenuButton, MenuButton);
request!(unpinAllGeneralForumTopicMessages, bool);
Expand Down