pub struct ChannelMessage {
pub id: String,
pub sender: String,
pub reply_target: String,
pub content: String,
pub channel: String,
pub channel_alias: Option<String>,
pub timestamp: u64,
pub thread_ts: Option<String>,
pub interruption_scope_id: Option<String>,
pub attachments: Vec<MediaAttachment>,
pub subject: Option<String>,
}Expand description
A message received from or sent to a channel
Fields§
§id: String§sender: String§reply_target: String§content: String§channel: String§channel_alias: Option<String>ZeroClaw channel alias (the <alias> half of [channels.<type>.<alias>])
when the platform supports multiple bot instances. Used by
session_key construction so two bots on the same platform compute
distinct session IDs and don’t share conversation history. None
for channels that don’t have an alias concept yet (webhook, cli).
timestamp: u64§thread_ts: Option<String>Platform thread identifier (e.g. Slack ts, Discord thread ID).
When set, replies should be posted as threaded responses.
interruption_scope_id: Option<String>Thread scope identifier for interruption/cancellation grouping.
Distinct from thread_ts (reply anchor): this is Some only when the message
is genuinely inside a reply thread and should be isolated from other threads.
None means top-level — scope is sender+channel only.
attachments: Vec<MediaAttachment>Media attachments (audio, images, video) for the media pipeline. Channels populate this when they receive media alongside a text message. Defaults to empty — existing channels are unaffected.
subject: Option<String>Email subject for reply threading.
Implementations§
Source§impl ChannelMessage
impl ChannelMessage
Sourcepub fn new(
id: impl Into<String>,
sender: impl Into<String>,
reply_target: impl Into<String>,
content: impl Into<String>,
channel: impl Into<String>,
timestamp: u64,
) -> Self
pub fn new( id: impl Into<String>, sender: impl Into<String>, reply_target: impl Into<String>, content: impl Into<String>, channel: impl Into<String>, timestamp: u64, ) -> Self
Construct a ChannelMessage with all required fields set and all optional
fields zeroed. Prefer this over raw struct literals so that new optional
fields added to ChannelMessage in the future don’t require mechanical
updates at every call site.
Trait Implementations§
Source§impl Clone for ChannelMessage
impl Clone for ChannelMessage
Source§fn clone(&self) -> ChannelMessage
fn clone(&self) -> ChannelMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more