pub struct InputMessage {
pub text: String,
pub reply_to: Option<i32>,
pub silent: bool,
pub background: bool,
pub clear_draft: bool,
pub no_webpage: bool,
pub entities: Option<Vec<MessageEntity>>,
pub reply_markup: Option<ReplyMarkup>,
pub schedule_date: Option<i32>,
}Expand description
Builder for composing outgoing messages.
use layer_client::InputMessage;
let msg = InputMessage::text("Hello, *world*!")
.silent(true)
.reply_to(Some(42));Fields§
§text: String§reply_to: Option<i32>§silent: bool§background: bool§clear_draft: bool§no_webpage: bool§entities: Option<Vec<MessageEntity>>§reply_markup: Option<ReplyMarkup>§schedule_date: Option<i32>Implementations§
Source§impl InputMessage
impl InputMessage
Sourcepub fn background(self, v: bool) -> Self
pub fn background(self, v: bool) -> Self
Send in background.
Sourcepub fn clear_draft(self, v: bool) -> Self
pub fn clear_draft(self, v: bool) -> Self
Clear the draft after sending.
Sourcepub fn no_webpage(self, v: bool) -> Self
pub fn no_webpage(self, v: bool) -> Self
Disable link preview.
Sourcepub fn entities(self, e: Vec<MessageEntity>) -> Self
pub fn entities(self, e: Vec<MessageEntity>) -> Self
Attach formatting entities (bold, italic, code, links, etc).
Sourcepub fn reply_markup(self, rm: ReplyMarkup) -> Self
pub fn reply_markup(self, rm: ReplyMarkup) -> Self
Attach a reply markup (inline or reply keyboard).
Sourcepub fn schedule_date(self, ts: Option<i32>) -> Self
pub fn schedule_date(self, ts: Option<i32>) -> Self
Schedule the message for a future Unix timestamp.
Trait Implementations§
Source§impl Clone for InputMessage
impl Clone for InputMessage
Source§fn clone(&self) -> InputMessage
fn clone(&self) -> InputMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for InputMessage
impl Default for InputMessage
Source§fn default() -> InputMessage
fn default() -> InputMessage
Returns the “default value” for a type. Read more
Source§impl From<&str> for InputMessage
impl From<&str> for InputMessage
Auto Trait Implementations§
impl Freeze for InputMessage
impl RefUnwindSafe for InputMessage
impl Send for InputMessage
impl Sync for InputMessage
impl Unpin for InputMessage
impl UnsafeUnpin for InputMessage
impl UnwindSafe for InputMessage
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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