Add InputPollOption struct

This commit is contained in:
Andrey Brusnik 2024-08-19 16:24:46 +04:00
parent f6c54d3363
commit 477fd49faa
No known key found for this signature in database
GPG key ID: D33232F28CFF442C
2 changed files with 26 additions and 0 deletions

View file

@ -88,6 +88,7 @@ pub use inline_query_results_button::*;
pub use input_file::*;
pub use input_media::*;
pub use input_message_content::*;
pub use input_poll_option::*;
pub use input_sticker::*;
pub use invoice::*;
pub use keyboard_button::*;
@ -227,6 +228,7 @@ mod inline_query_results_button;
mod input_file;
mod input_media;
mod input_message_content;
mod input_poll_option;
mod input_sticker;
mod invoice;
mod keyboard_button;

View file

@ -0,0 +1,24 @@
use serde::{Deserialize, Serialize};
use crate::types::{MessageEntity, ParseMode};
/// This object contains information about one answer option in a poll to send.
///
/// [The official docs](https://core.telegram.org/bots/api#inputpolloption).
#[derive(Clone, Debug)]
#[derive(PartialEq, Eq, Hash)]
#[derive(Serialize, Deserialize)]
pub struct InputPollOption {
/// Option text, 1-100 characters.
pub text: String,
/// Mode for parsing entities in the text. See [formatting options] for more
/// details. Currently, only custom emoji entities are allowed.
///
/// [formatting options]: https://core.telegram.org/bots/api#formatting-options
pub text_parse_mode: Option<ParseMode>,
/// A JSON-serialized list of special entities that appear in the poll
/// option text. It can be specified instead of _text\_parse\_mode_.
pub text_entities: Option<Vec<MessageEntity>>,
}