pub struct SendPoll { /* private fields */ }Expand description
Builder for the sendPoll method.
Implementations§
Source§impl SendPoll
impl SendPoll
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, correct_option_id: u8) -> Self
pub fn quiz(self, correct_option_id: u8) -> Self
Converts the poll to a quiz with the given correct option index.
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 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 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.).
Trait Implementations§
Source§impl IntoFuture for SendPoll
impl IntoFuture for SendPoll
Source§type IntoFuture = Pin<Box<dyn Future<Output = <SendPoll as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <SendPoll as IntoFuture>::Output> + Send>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. 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 UnsafeUnpin 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