pub struct SendPoll { /* private fields */ }
Expand description
Sends a native poll.
On success, the sent Message
is returned.
Implementations§
source§impl SendPoll
impl SendPoll
sourcepub fn new<A, B, C, D>(chat_id: A, question: B, options: C) -> SendPoll
pub fn new<A, B, C, D>(chat_id: A, question: B, options: C) -> SendPoll
Creates a new SendPoll
.
§Arguments
chat_id
- Unique identifier of the target chat.question
- Question; 1-300 characters.options
- Answer options; 2-10 strings 1-100 characters each.
sourcepub fn with_allows_multiple_answers(self, value: bool) -> SendPoll
pub fn with_allows_multiple_answers(self, value: bool) -> SendPoll
Sets a new value for an allows_multiple_answers
flag.
§Arguments
value
- Indicates whether the poll allows multiple answers; default -false
.
sourcepub fn with_business_connection_id<T>(self, value: T) -> SendPoll
pub fn with_business_connection_id<T>(self, value: T) -> SendPoll
Sets a new business connection ID.
§Arguments
value
- Unique identifier of the business connection on behalf.
sourcepub fn with_close_date(self, value: i64) -> SendPoll
pub fn with_close_date(self, value: i64) -> SendPoll
Sets a new close date.
§Arguments
value
- Point in time (Unix timestamp) when the poll will be automatically closed.
Must be at least 5 and no more than 600 seconds in the future.
Can’t be used together with Self::with_open_period
(open period will be set to None
)
sourcepub fn with_disable_notification(self, value: bool) -> SendPoll
pub fn with_disable_notification(self, value: bool) -> SendPoll
Sets a new value for a disable_notification
flag.
§Arguments
value
- Indicates whether to send the message silently or not; a user will receive a notification without sound.
sourcepub fn with_is_anonymous(self, value: bool) -> SendPoll
pub fn with_is_anonymous(self, value: bool) -> SendPoll
Sets a new value for an is_anonymous
flag.
§Arguments
value
- Indicates whether the poll needs to be anonymous; default -true
.
sourcepub fn with_is_closed(self, value: bool) -> SendPoll
pub fn with_is_closed(self, value: bool) -> SendPoll
Sets a new value for an is_closed
flag.
§Arguments
value
- Indicates whether the poll needs to be immediately closed.
sourcepub fn with_message_thread_id(self, value: i64) -> SendPoll
pub fn with_message_thread_id(self, value: i64) -> SendPoll
Sets a new message thread ID.
§Arguments
value
- Unique identifier of the target message thread; supergroups only.
sourcepub fn with_open_period(self, value: i64) -> SendPoll
pub fn with_open_period(self, value: i64) -> SendPoll
sourcepub fn with_protect_content(self, value: bool) -> SendPoll
pub fn with_protect_content(self, value: bool) -> SendPoll
Sets a new value for a protect_content
flag.
§Arguments
value
- Indicates whether to protect the contents of the sent message from forwarding and saving.
sourcepub fn with_question_entities<T>(self, value: T) -> SendPollwhere
T: IntoIterator<Item = TextEntity>,
pub fn with_question_entities<T>(self, value: T) -> SendPollwhere
T: IntoIterator<Item = TextEntity>,
sourcepub fn with_question_parse_mode(self, value: ParseMode) -> SendPoll
pub fn with_question_parse_mode(self, value: ParseMode) -> SendPoll
sourcepub fn with_reply_markup<T>(self, value: T) -> SendPollwhere
T: Into<ReplyMarkup>,
pub fn with_reply_markup<T>(self, value: T) -> SendPollwhere
T: Into<ReplyMarkup>,
sourcepub fn with_reply_parameters(self, value: ReplyParameters) -> SendPoll
pub fn with_reply_parameters(self, value: ReplyParameters) -> SendPoll
Trait Implementations§
source§impl Serialize for SendPoll
impl Serialize for SendPoll
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for SendPoll
impl RefUnwindSafe for SendPoll
impl Send for SendPoll
impl Sync for SendPoll
impl Unpin for SendPoll
impl UnwindSafe for SendPoll
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more