Struct grammers_client::types::input_message::InputMessage [−][src]
pub struct InputMessage { /* fields omitted */ }Construct and send rich text messages with various options.
Implementations
impl InputMessage[src]
impl InputMessage[src]pub fn background(self, background: bool) -> Self[src]
Whether to “send this message as a background message”.
This description is taken from https://core.telegram.org/method/messages.sendMessage.
pub fn clear_draft(self, clear_draft: bool) -> Self[src]
Whether the draft in this chat, if any, should be cleared.
pub fn fmt_entities(self, entities: Vec<MessageEntity>) -> Self[src]
The formatting entities within the message (such as bold, italics, etc.).
pub fn link_preview(self, link_preview: bool) -> Self[src]
Whether the link preview be shown for the message.
This has no effect when sending media, which cannot contain a link preview.
pub fn reply_markup(self, reply_markup: Option<ReplyMarkup>) -> Self[src]
The reply markup to show under the message.
User accounts cannot use markup, and it will be ignored if set.
pub fn reply_to(self, reply_to: Option<i32>) -> Self[src]
The message identifier to which this message should reply to, if any.
Otherwise, this message will not be a reply to any other.
pub fn schedule_date(self, schedule_date: Option<SystemTime>) -> Self[src]
If set to a distant enough future time, the message won’t be sent immediately, and instead it will be scheduled to be automatically sent at a later time.
This scheduling is done server-side, and may not be accurate to the second.
Bot accounts cannot schedule messages.
pub fn schedule_once_online(self) -> Self[src]
Schedule the message to be sent once the person comes online.
This only works in private chats, and only if the person has their last seen visible.
Bot accounts cannot schedule messages.
pub fn silent(self, silent: bool) -> Self[src]
Whether the message should notify people or not.
Defaults to false, which means it will notify them. Set it to true
to alter this behaviour.
pub fn photo(self, file: Uploaded) -> Self[src]
Include the uploaded file as a photo in the message.
The server will compress the image and convert it to JPEG format if necessary.
The text will be the caption of the photo, which may be empty for no caption.
pub fn document(self, file: Uploaded) -> Self[src]
Include the uploaded file as a document in the message.
You can use this to send videos, stickers, audios, or uncompressed photos.
The text will be the caption of the document, which may be empty for no caption.
pub fn copy_media(self, media: &Media) -> Self[src]
Copy media from an existing message.
You can use this to send media from another message without re-uploading it.
pub fn file(self, file: Uploaded) -> Self[src]
Include the uploaded file as a document file in the message.
You can use this to send any type of media as a simple document file.
The text will be the caption of the file, which may be empty for no caption.
pub fn media_ttl(self, seconds: i32) -> Self[src]
Change the media’s Time To Live (TTL).
For example, this enables you to send a photo that can only be viewed for a certain
amount of seconds before it expires.
Not all media supports this feature.
This method should be called before setting any media, else it won’t have any effect.
pub fn mime_type(self, mime_type: &str) -> Self[src]
Change the media’s mime type.
This method will override the mime type that would otherwise be automatically inferred from the extension of the used file
If no mime type is set and it cannot be inferred, the mime type will be “application/octet-stream”.
This method should be called before setting any media, else it won’t have any effect.
pub fn text<T: AsRef<str>>(s: T) -> Self[src]
Builds a new message using the given plaintext as the message contents.
Trait Implementations
impl Default for InputMessage[src]
impl Default for InputMessage[src]fn default() -> InputMessage[src]
Auto Trait Implementations
impl RefUnwindSafe for InputMessage
impl RefUnwindSafe for InputMessageimpl Send for InputMessage
impl Send for InputMessageimpl Sync for InputMessage
impl Sync for InputMessageimpl Unpin for InputMessage
impl Unpin for InputMessageimpl UnwindSafe for InputMessage
impl UnwindSafe for InputMessage