Struct SendMessage
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>,
pub suppress_voice: bool,
pub force_voice: bool,
}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).
suppress_voice: boolWhen true, channels that support TTS must not synthesise this
message as a voice note. Use for error notices, system alerts, and
other non-conversational content that should never be voiced.
force_voice: boolWhen true, channels that support TTS must deliver this message as
a voice note even if the peer’s default modality is text.
Ignored when suppress_voice is also true.
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 suppress_voice(self) -> Self
pub fn suppress_voice(self) -> Self
Prevent TTS channels from voicing this message.
Sourcepub fn force_voice(self) -> Self
pub fn force_voice(self) -> Self
Force TTS channels to deliver this message as a voice note.
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
pub fn reply_to(msg: &ChannelMessage, content: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for SendMessage
impl Clone for SendMessage
Source§fn clone(&self) -> SendMessage
fn clone(&self) -> SendMessage
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more