pub struct SendPoll { /* private fields */ }Expand description
Builder for the sendPoll method.
Implementations§
Source§impl SendPoll
impl SendPoll
Sourcepub fn message_thread_id(self, id: i64) -> Self
pub fn message_thread_id(self, id: i64) -> Self
Forum topic thread ID.
Sourcepub fn direct_messages_topic_id(self, id: i64) -> Self
pub fn direct_messages_topic_id(self, id: i64) -> Self
Identifier of a direct messages chat topic.
Sourcepub fn is_anonymous(self, v: bool) -> Self
pub fn is_anonymous(self, v: bool) -> Self
Sets whether the poll is anonymous.
Sourcepub fn allows_multiple_answers(self, v: bool) -> Self
pub fn allows_multiple_answers(self, v: bool) -> Self
Allows voters to select multiple answers.
Sourcepub fn allows_revoting(self, v: bool) -> Self
pub fn allows_revoting(self, v: bool) -> Self
Allows voters to change their vote.
Sourcepub fn quiz(self, ids: Vec<u8>) -> Self
pub fn quiz(self, ids: Vec<u8>) -> Self
Converts the poll to a quiz with the given correct option indices.
Sourcepub fn quiz_single(self, id: u8) -> Self
pub fn quiz_single(self, id: u8) -> Self
Convenience method for a quiz with a single correct option.
Sourcepub fn explanation(self, text: impl Into<String>) -> Self
pub fn explanation(self, text: impl Into<String>) -> Self
Sets the explanation text shown after a quiz answer.
Sourcepub fn explanation_parse_mode(self, mode: ParseMode) -> Self
pub fn explanation_parse_mode(self, mode: ParseMode) -> Self
Sets the parse mode for the explanation.
Sourcepub fn explanation_entities(self, e: Vec<MessageEntity>) -> Self
pub fn explanation_entities(self, e: Vec<MessageEntity>) -> Self
Sets entities for the explanation.
Sourcepub fn open_period(self, secs: u32) -> Self
pub fn open_period(self, secs: u32) -> Self
Sets how long the poll stays open in seconds (5–2628000).
Sourcepub fn close_date(self, ts: i64) -> Self
pub fn close_date(self, ts: i64) -> Self
Sets the Unix timestamp when the poll closes automatically.
Sourcepub fn shuffle_options(self, v: bool) -> Self
pub fn shuffle_options(self, v: bool) -> Self
Sets whether the options should be shuffled.
Sourcepub fn allow_adding_options(self, v: bool) -> Self
pub fn allow_adding_options(self, v: bool) -> Self
Allows users to add their own options to the poll.
Sourcepub fn hide_results_until_closes(self, v: bool) -> Self
pub fn hide_results_until_closes(self, v: bool) -> Self
Hides the poll results until it’s closed.
Sourcepub fn description(self, d: impl Into<String>) -> Self
pub fn description(self, d: impl Into<String>) -> Self
Sets the poll description (0-1024 chars).
Sourcepub fn description_parse_mode(self, mode: ParseMode) -> Self
pub fn description_parse_mode(self, mode: ParseMode) -> Self
Sets description parse mode.
Sourcepub fn description_entities(self, e: Vec<MessageEntity>) -> Self
pub fn description_entities(self, e: Vec<MessageEntity>) -> Self
Sets description entities.
Sourcepub fn question_parse_mode(self, mode: ParseMode) -> Self
pub fn question_parse_mode(self, mode: ParseMode) -> Self
Sets the question parse mode.
Sourcepub fn question_entities(self, e: Vec<MessageEntity>) -> Self
pub fn question_entities(self, e: Vec<MessageEntity>) -> Self
Sets question entities.
Sourcepub fn disable_notification(self, v: bool) -> Self
pub fn disable_notification(self, v: bool) -> Self
Sends the message silently — the recipient receives no notification sound.
Sourcepub fn reply_markup(self, m: impl Into<ReplyMarkup>) -> Self
pub fn reply_markup(self, m: impl Into<ReplyMarkup>) -> Self
Attaches a reply markup (inline keyboard, reply keyboard, etc.).
Sourcepub fn suggested_post_parameters(self, params: SuggestedPostParameters) -> Self
pub fn suggested_post_parameters(self, params: SuggestedPostParameters) -> Self
Suggested post parameters for channel direct messages chats.
Sourcepub fn members_only(self, v: bool) -> Self
pub fn members_only(self, v: bool) -> Self
Pass true to limit voting to users who have been members of the chat for more than
24 hours; for channel chats only.
Sourcepub fn country_codes(self, codes: Vec<impl Into<String>>) -> Self
pub fn country_codes(self, codes: Vec<impl Into<String>>) -> Self
Two-letter ISO 3166-1 alpha-2 country codes for countries from which users can vote; channels only.
Sourcepub fn media(self, m: InputPollMedia) -> Self
pub fn media(self, m: InputPollMedia) -> Self
Media added to the poll description.
Sourcepub fn explanation_media(self, m: InputPollMedia) -> Self
pub fn explanation_media(self, m: InputPollMedia) -> Self
Media added to the quiz explanation.
Sourcepub fn business_connection_id(self, v: impl Into<String>) -> Self
pub fn business_connection_id(self, v: impl Into<String>) -> Self
Business connection ID for acting on behalf of a business account.
Sourcepub fn allow_paid_broadcast(self, v: bool) -> Self
pub fn allow_paid_broadcast(self, v: bool) -> Self
Allows sending to large audiences at the cost of Telegram Stars.
Sourcepub fn message_effect_id(self, v: impl Into<String>) -> Self
pub fn message_effect_id(self, v: impl Into<String>) -> Self
Attaches a message effect (animated emoji reaction) to the message.
Sourcepub fn is_closed(self, v: bool) -> Self
pub fn is_closed(self, v: bool) -> Self
Sends the poll already closed, so it cannot be voted on.
Sourcepub fn protect_content(self, v: bool) -> Self
pub fn protect_content(self, v: bool) -> Self
Protects the message from being forwarded or saved.
Sourcepub fn reply_parameters(self, v: ReplyParameters) -> Self
pub fn reply_parameters(self, v: ReplyParameters) -> Self
Reply parameters for this message.