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>,
) -> SendMessage
pub fn new( content: impl Into<String>, recipient: impl Into<String>, ) -> SendMessage
Create a new message with content and recipient
Sourcepub fn suppress_voice(self) -> SendMessage
pub fn suppress_voice(self) -> SendMessage
Prevent TTS channels from voicing this message.
Sourcepub fn force_voice(self) -> SendMessage
pub fn force_voice(self) -> SendMessage
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>,
) -> SendMessage
pub fn with_subject( content: impl Into<String>, recipient: impl Into<String>, subject: impl Into<String>, ) -> SendMessage
Create a new message with content, recipient, and subject
Sourcepub fn in_reply_to(self, msg_id: Option<String>) -> SendMessage
pub fn in_reply_to(self, msg_id: Option<String>) -> SendMessage
Set the In-Reply-To header for email threading.
Sourcepub fn subject(self, subject: impl Into<String>) -> SendMessage
pub fn subject(self, subject: impl Into<String>) -> SendMessage
Set the subject on an existing SendMessage (builder style).
Sourcepub fn in_thread(self, thread_ts: Option<String>) -> SendMessage
pub fn in_thread(self, thread_ts: Option<String>) -> SendMessage
Set the thread identifier for threaded replies.
Sourcepub fn with_cancellation(self, token: CancellationToken) -> SendMessage
pub fn with_cancellation(self, token: CancellationToken) -> SendMessage
Attach a cancellation token for interruptible delivery.
Sourcepub fn with_attachments(self, attachments: Vec<MediaAttachment>) -> SendMessage
pub fn with_attachments(self, attachments: Vec<MediaAttachment>) -> SendMessage
Attach files to this message.
Source§impl SendMessage
impl SendMessage
pub fn reply_to(msg: &ChannelMessage, content: impl Into<String>) -> SendMessage
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 moreAuto Trait Implementations§
impl Freeze for SendMessage
impl RefUnwindSafe for SendMessage
impl Send for SendMessage
impl Sync for SendMessage
impl Unpin for SendMessage
impl UnsafeUnpin for SendMessage
impl UnwindSafe for SendMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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