Abstract Shape of the platform-specific params object
inside ChannelAuthConfig. Defaults to Record<string, string>.
Optional retryConfig: Partial<RetryConfig>Protected Abstract doEstablish the platform connection using the supplied credentials.
Called by initialize after state has been set to connecting.
Must throw on failure — the base class handles retry and state changes.
Protected Abstract doDeliver a message to the external platform.
Called by sendMessage only when the adapter is connected.
Protected Abstract doRelease platform resources (close WebSocket, stop polling, etc.).
Called by shutdown before the state transitions to disconnected.
Initialize the adapter with auth credentials. If already connected this will shut down the existing connection first (idempotent).
Get the current connection status and metadata.
Send a message to a conversation on the external platform.
Platform-native conversation/chat ID.
Message content to send.
The platform-assigned message ID.
Register an event handler. Returns an unsubscribe function.
Optional eventTypes: ChannelEventType[]Protected emitEmit an event to all matching subscribers. Subclasses call this when the platform SDK receives an inbound event.
Protected emitConvenience helper: emit a connection_change event with the current
status. Called automatically by setStatus.
Protected hasCheck whether this adapter declares a specific capability.
Protected setTransition to a new connection status and emit an event.
Optional error: stringReadonly Abstract platformPlatform this adapter serves.
Readonly Abstract displayHuman-readable display name (e.g., "WhatsApp Business").
Readonly Abstract capabilitiesDeclared capabilities of this adapter.
Protected statusProtected connectedProtected errorProtected platformProtected authStored auth config so reconnect() can re-use it.
Protected Readonly retry
Abstract base class that implements common IChannelAdapter behaviour. Concrete adapters (Telegram, Discord, IRC, ...) extend this class and implement the three abstract hooks:
doConnect(auth)-- establish the platform connection.doSendMessage(conversationId, content)-- deliver a message.doShutdown()-- tear down the platform connection.