Skip to content

Commit

Permalink
add InputPollOption
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed May 14, 2024
1 parent 75a1027 commit fb5f8dd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::objects::{
InlineQueryResultCachedVoice, InlineQueryResultContact, InlineQueryResultDocument,
InlineQueryResultGame, InlineQueryResultGif, InlineQueryResultLocation,
InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVenue,
InlineQueryResultVideo, InlineQueryResultVoice, InputSticker, LabeledPrice, LinkPreviewOptions,
MaskPosition, MenuButton, MessageEntity, PassportElementErrorDataField,
InlineQueryResultVideo, InlineQueryResultVoice, InputPollOption, InputSticker, LabeledPrice,
LinkPreviewOptions, MaskPosition, MenuButton, MessageEntity, PassportElementErrorDataField,
PassportElementErrorFile, PassportElementErrorFiles, PassportElementErrorFrontSide,
PassportElementErrorReverseSide, PassportElementErrorSelfie,
PassportElementErrorTranslationFile, PassportElementErrorTranslationFiles,
Expand Down Expand Up @@ -1088,7 +1088,7 @@ pub struct SendPollParams {
#[builder(setter(into, strip_option), default)]
pub question_entities: Option<Vec<MessageEntity>>,

pub options: Vec<String>,
pub options: Vec<InputPollOption>,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
Expand Down
15 changes: 15 additions & 0 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,21 @@ pub struct PollOption {
pub voter_count: u32,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct InputPollOption {
#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub text: Option<String>,

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

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub text_entities: Option<Vec<MessageEntity>>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)]
pub struct PollAnswer {
#[builder(setter(into))]
Expand Down

0 comments on commit fb5f8dd

Please sign in to comment.