Skip to content

Commit

Permalink
Bot API 8.0 - Media Sharing and File Downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed Dec 1, 2024
1 parent e893d10 commit 973e1d2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
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 SavePreparedInlineMessage {
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
6 changes: 6 additions & 0 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,12 @@ pub struct ChosenInlineResult {
pub query: String,
}

#[apply(apistruct!)]
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

0 comments on commit 973e1d2

Please sign in to comment.