pub struct SendQuiz { /* private fields */ }
Expand description
Sends a quiz.
On success, the sent Message
is returned.
Implementations§
source§impl SendQuiz
impl SendQuiz
sourcepub fn new<A, B, C, D>(
chat_id: A,
question: B,
correct_option_id: i64,
options: C
) -> SendQuiz
pub fn new<A, B, C, D>( chat_id: A, question: B, correct_option_id: i64, options: C ) -> SendQuiz
Creates a new SendQuiz
.
§Arguments
chat_id
- Unique identifier of the target chat.question
- Question; 1-300 characters.correct_option_id
- 0-based identifier of the correct answer option.options
- Answer options; 2-10 strings 1-100 characters each.
sourcepub fn with_business_connection_id<T>(self, value: T) -> SendQuiz
pub fn with_business_connection_id<T>(self, value: T) -> SendQuiz
sourcepub fn with_close_date(self, value: i64) -> SendQuiz
pub fn with_close_date(self, value: i64) -> SendQuiz
Sets a new close date.
§Arguments
value
- Point in time (Unix timestamp) when the quiz 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) -> SendQuiz
pub fn with_disable_notification(self, value: bool) -> SendQuiz
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_explanation<T>(self, value: T) -> SendQuiz
pub fn with_explanation<T>(self, value: T) -> SendQuiz
Sets a new explanation.
§Arguments
value
- Text that is shown when a user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds after entities parsing.
sourcepub fn with_explanation_entities<T>(self, value: T) -> SendQuizwhere
T: IntoIterator<Item = TextEntity>,
pub fn with_explanation_entities<T>(self, value: T) -> SendQuizwhere
T: IntoIterator<Item = TextEntity>,
sourcepub fn with_explanation_parse_mode(self, value: ParseMode) -> SendQuiz
pub fn with_explanation_parse_mode(self, value: ParseMode) -> SendQuiz
sourcepub fn with_is_anonymous(self, value: bool) -> SendQuiz
pub fn with_is_anonymous(self, value: bool) -> SendQuiz
Sets a new value for an is_anonymous
flag.
§Arguments
value
- Indicates whether the quiz needs to be anonymous; default -true
.
sourcepub fn with_is_closed(self, value: bool) -> SendQuiz
pub fn with_is_closed(self, value: bool) -> SendQuiz
Sets a new value for an is_closed
flag.
§Arguments
value
- Indicates whether the quiz needs to be immediately closed.
sourcepub fn with_message_thread_id(self, value: i64) -> SendQuiz
pub fn with_message_thread_id(self, value: i64) -> SendQuiz
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) -> SendQuiz
pub fn with_open_period(self, value: i64) -> SendQuiz
Sets a new open period.
§Arguments
value
- Amount of time in seconds the quiz will be active after creation; 5-600.
Can’t be used together with Self::with_close_date
(close date will be set to None
).
sourcepub fn with_protect_content(self, value: bool) -> SendQuiz
pub fn with_protect_content(self, value: bool) -> SendQuiz
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) -> SendQuizwhere
T: IntoIterator<Item = TextEntity>,
pub fn with_question_entities<T>(self, value: T) -> SendQuizwhere
T: IntoIterator<Item = TextEntity>,
sourcepub fn with_question_parse_mode(self, value: ParseMode) -> SendQuiz
pub fn with_question_parse_mode(self, value: ParseMode) -> SendQuiz
sourcepub fn with_reply_markup<T>(self, value: T) -> SendQuizwhere
T: Into<ReplyMarkup>,
pub fn with_reply_markup<T>(self, value: T) -> SendQuizwhere
T: Into<ReplyMarkup>,
sourcepub fn with_reply_parameters(self, value: ReplyParameters) -> SendQuiz
pub fn with_reply_parameters(self, value: ReplyParameters) -> SendQuiz
Trait Implementations§
source§impl Serialize for SendQuiz
impl Serialize for SendQuiz
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 SendQuiz
impl RefUnwindSafe for SendQuiz
impl Send for SendQuiz
impl Sync for SendQuiz
impl Unpin for SendQuiz
impl UnwindSafe for SendQuiz
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