Class SignalChannel
Signal channel adapter that bridges to signal-cli via JSON-RPC over stdin/stdout. Requires signal-cli to be installed and registered with a phone number. Supports prefix-based commands via ICommandAwareChannel.
public sealed class SignalChannel : IChannel, IAsyncDisposable, ICommandAwareChannel
- Inheritance
-
SignalChannel
- Implements
- Inherited Members
Constructors
SignalChannel(string, string?)
public SignalChannel(string account, string? signalCliPath = null)
Parameters
Fields
CommandPrefix
Prefix for Signal commands (e.g., "!jdai-help").
public const string CommandPrefix = "!jdai-"
Field Value
SlashPrefix
Alternate slash prefix (e.g., "/jdai-help").
public const string SlashPrefix = "/jdai-"
Field Value
Properties
ChannelType
Unique channel type identifier (e.g., "discord", "signal", "web").
public string ChannelType { get; }
Property Value
DisplayName
Display name for this channel instance.
public string DisplayName { get; }
Property Value
IsConnected
Whether the channel is currently connected and healthy.
public bool IsConnected { get; }
Property Value
Methods
ConnectAsync(CancellationToken)
Connects to the messaging platform.
public Task ConnectAsync(CancellationToken ct = default)
Parameters
Returns
DisconnectAsync(CancellationToken)
Gracefully disconnects.
public Task DisconnectAsync(CancellationToken ct = default)
Parameters
Returns
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
Returns
- ValueTask
A task that represents the asynchronous dispose operation.
RegisterCommandsAsync(ICommandRegistry, CancellationToken)
Registers commands from the registry as platform-native commands. Called after ConnectAsync when commands are available.
public Task RegisterCommandsAsync(ICommandRegistry registry, CancellationToken ct = default)
Parameters
registryICommandRegistryctCancellationToken
Returns
SendMessageAsync(string, string, CancellationToken)
Sends a message to the specified conversation/thread.
public Task SendMessageAsync(string conversationId, string content, CancellationToken ct = default)
Parameters
conversationIdstringcontentstringctCancellationToken
Returns
Events
MessageReceived
Raised when a new inbound message arrives.
public event Func<ChannelMessage, Task>? MessageReceived
Event Type
Remarks
Uses Func<ChannelMessage, Task> instead of EventHandler to support async handlers.