pub struct MessageContext {
pub message_id: String,
pub server_message_id: Option<i64>,
pub from: String,
pub to: String,
pub timestamp: i64,
pub session_id: Option<String>,
pub context_token: Option<String>,
pub body: Option<String>,
pub media: Option<MediaInfo>,
pub ref_message: Option<RefMessageInfo>,
/* private fields */
}Expand description
Inbound message context passed to the handler.
Fields§
§message_id: StringSDK-generated message session ID.
server_message_id: Option<i64>Server-assigned message ID.
from: StringSender user ID.
to: StringRecipient user ID.
timestamp: i64Creation timestamp (ms).
session_id: Option<String>Session ID.
context_token: Option<String>Context token for replies.
body: Option<String>Text body (including quoted text).
media: Option<MediaInfo>Media attachment info.
ref_message: Option<RefMessageInfo>Referenced (quoted) message info.
Implementations§
Source§impl MessageContext
impl MessageContext
Sourcepub async fn reply_text(&self, text: &str) -> Result<SendResult>
pub async fn reply_text(&self, text: &str) -> Result<SendResult>
Reply with a text message.
Sourcepub async fn reply_media(&self, file_path: &Path) -> Result<SendResult>
pub async fn reply_media(&self, file_path: &Path) -> Result<SendResult>
Reply with a media file.
Sourcepub async fn download_media(
&self,
media: &MediaInfo,
dest: &Path,
) -> Result<PathBuf>
pub async fn download_media( &self, media: &MediaInfo, dest: &Path, ) -> Result<PathBuf>
Download media from this message to a destination path.
Sourcepub async fn send_typing(&self) -> Result<()>
pub async fn send_typing(&self) -> Result<()>
Send a typing indicator.
Sourcepub async fn cancel_typing(&self) -> Result<()>
pub async fn cancel_typing(&self) -> Result<()>
Cancel the typing indicator.
Auto Trait Implementations§
impl Freeze for MessageContext
impl !RefUnwindSafe for MessageContext
impl Send for MessageContext
impl Sync for MessageContext
impl Unpin for MessageContext
impl UnsafeUnpin for MessageContext
impl !UnwindSafe for MessageContext
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