pub struct SendMessage {
pub content: String,
pub recipient: String,
pub subject: Option<String>,
pub thread_ts: Option<String>,
pub cancellation_token: Option<CancellationToken>,
pub attachments: Vec<MediaAttachment>,
pub in_reply_to: Option<String>,
}Expand description
Message to send through a channel
Fields§
§content: String§recipient: String§subject: Option<String>§thread_ts: Option<String>Platform thread identifier for threaded replies (e.g. Slack thread_ts).
cancellation_token: Option<CancellationToken>Optional cancellation token for interruptible delivery (e.g. multi-message mode).
attachments: Vec<MediaAttachment>File attachments to send with the message. Channels that don’t support attachments ignore this field.
in_reply_to: Option<String>Message-ID to set as In-Reply-To header (email threading).
Implementations§
Source§impl SendMessage
impl SendMessage
Sourcepub fn new(content: impl Into<String>, recipient: impl Into<String>) -> Self
pub fn new(content: impl Into<String>, recipient: impl Into<String>) -> Self
Create a new message with content and recipient
Sourcepub fn with_subject(
content: impl Into<String>,
recipient: impl Into<String>,
subject: impl Into<String>,
) -> Self
pub fn with_subject( content: impl Into<String>, recipient: impl Into<String>, subject: impl Into<String>, ) -> Self
Create a new message with content, recipient, and subject
Sourcepub fn in_reply_to(self, msg_id: Option<String>) -> Self
pub fn in_reply_to(self, msg_id: Option<String>) -> Self
Set the In-Reply-To header for email threading.
Sourcepub fn subject(self, subject: impl Into<String>) -> Self
pub fn subject(self, subject: impl Into<String>) -> Self
Set the subject on an existing SendMessage (builder style).
Sourcepub fn in_thread(self, thread_ts: Option<String>) -> Self
pub fn in_thread(self, thread_ts: Option<String>) -> Self
Set the thread identifier for threaded replies.
Sourcepub fn with_cancellation(self, token: CancellationToken) -> Self
pub fn with_cancellation(self, token: CancellationToken) -> Self
Attach a cancellation token for interruptible delivery.
Sourcepub fn with_attachments(self, attachments: Vec<MediaAttachment>) -> Self
pub fn with_attachments(self, attachments: Vec<MediaAttachment>) -> Self
Attach files to this message.
Source§impl SendMessage
impl SendMessage
Sourcepub fn reply_to(msg: &ChannelMessage, content: impl Into<String>) -> Self
pub fn reply_to(msg: &ChannelMessage, content: impl Into<String>) -> Self
Build a reply SendMessage from an inbound ChannelMessage.
Sets recipient from msg.reply_target, threads via in_reply_to and
thread_ts, and prepends Re: to the subject when the inbound message
carried one. Safe to call from any channel handler; the in_reply_to
field is silently ignored by channels that don’t support it.
Trait Implementations§
Source§impl Clone for SendMessage
impl Clone for SendMessage
Source§fn clone(&self) -> SendMessage
fn clone(&self) -> SendMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more