Interface IChannel
Unified abstraction for a messaging channel (Discord, Slack, Signal, Web, etc.).
public interface IChannel : IAsyncDisposable
- Inherited Members
Properties
ChannelType
Unique channel type identifier (e.g., "discord", "signal", "web").
string ChannelType { get; }
Property Value
DisplayName
Display name for this channel instance.
string DisplayName { get; }
Property Value
IsConnected
Whether the channel is currently connected and healthy.
bool IsConnected { get; }
Property Value
Methods
ConnectAsync(CancellationToken)
Connects to the messaging platform.
Task ConnectAsync(CancellationToken ct = default)
Parameters
Returns
DisconnectAsync(CancellationToken)
Gracefully disconnects.
Task DisconnectAsync(CancellationToken ct = default)
Parameters
Returns
ReactAsync(string, string, string, CancellationToken)
Adds a reaction emoji to a message. Not all channels support this — default is no-op.
Task ReactAsync(string conversationId, string messageId, string emoji, CancellationToken ct = default)
Parameters
conversationIdstringmessageIdstringemojistringctCancellationToken
Returns
SendMessageAsync(string, string, CancellationToken)
Sends a message to the specified conversation/thread.
Task SendMessageAsync(string conversationId, string content, CancellationToken ct = default)
Parameters
conversationIdstringcontentstringctCancellationToken
Returns
SendMessageWithAttachmentsAsync(string, string?, IReadOnlyList<OutboundAttachment>, CancellationToken)
Sends a message with file attachments. Channels that don't support attachments fall back to sending the text content only.
Task SendMessageWithAttachmentsAsync(string conversationId, string? content, IReadOnlyList<OutboundAttachment> attachments, CancellationToken ct = default)
Parameters
conversationIdstringcontentstringattachmentsIReadOnlyList<OutboundAttachment>ctCancellationToken
Returns
Events
MessageReceived
Raised when a new inbound message arrives.
event Func<ChannelMessage, Task>? MessageReceived
Event Type
Remarks
Uses Func<ChannelMessage, Task> instead of EventHandler to support async handlers.