Skip to content

Commit

Permalink
Bot API 7.0: Link Preview Customization
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed Jan 2, 2024
1 parent da14c54 commit 53b191b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/api_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ use crate::objects::{
InlineQueryResultCachedVoice, InlineQueryResultContact, InlineQueryResultDocument,
InlineQueryResultGame, InlineQueryResultGif, InlineQueryResultLocation,
InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVenue,
InlineQueryResultVideo, InlineQueryResultVoice, InputSticker, LabeledPrice, MaskPosition,
MenuButton, MessageEntity, PassportElementErrorDataField, PassportElementErrorFile,
PassportElementErrorFiles, PassportElementErrorFrontSide, PassportElementErrorReverseSide,
PassportElementErrorSelfie, PassportElementErrorTranslationFile,
PassportElementErrorTranslationFiles, PassportElementErrorUnspecified, PollType, ReactionType,
ReplyKeyboardMarkup, ReplyKeyboardRemove, ShippingOption, StickerFormat, StickerType,
WebAppInfo,
InlineQueryResultVideo, InlineQueryResultVoice, InputSticker, LabeledPrice, LinkPreviewOptions,
MaskPosition, MenuButton, MessageEntity, PassportElementErrorDataField,
PassportElementErrorFile, PassportElementErrorFiles, PassportElementErrorFrontSide,
PassportElementErrorReverseSide, PassportElementErrorSelfie,
PassportElementErrorTranslationFile, PassportElementErrorTranslationFiles,
PassportElementErrorUnspecified, PollType, ReactionType, ReplyKeyboardMarkup,
ReplyKeyboardRemove, ShippingOption, StickerFormat, StickerType, WebAppInfo,
};
use crate::{AllowedUpdate, ParseMode};
use serde::Deserialize;
Expand Down Expand Up @@ -298,7 +298,7 @@ pub struct SendMessageParams {

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub disable_web_page_preview: Option<bool>,
pub link_preview_options: Option<LinkPreviewOptions>,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
Expand Down Expand Up @@ -1688,7 +1688,7 @@ pub struct EditMessageTextParams {

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub disable_web_page_preview: Option<bool>,
pub link_preview_options: Option<LinkPreviewOptions>,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
Expand Down
8 changes: 6 additions & 2 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,10 @@ pub struct Message {
#[builder(setter(into, strip_option), default)]
pub entities: Option<Vec<MessageEntity>>,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub link_preview_options: Option<LinkPreviewOptions>,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub animation: Option<Box<Animation>>,
Expand Down Expand Up @@ -1060,7 +1064,7 @@ pub struct MessageOriginChannel {
pub author_signature: Option<String>,
}

#[derive(Builder, Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Builder, Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct LinkPreviewOptions {
#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
Expand Down Expand Up @@ -2937,7 +2941,7 @@ pub struct InputTextMessageContent {

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub disable_web_page_preview: Option<bool>,
pub link_preview_options: Option<LinkPreviewOptions>,
}

#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Builder)]
Expand Down

0 comments on commit 53b191b

Please sign in to comment.