API Reference
ChannelSource
Defined in: channels/channel-source.types.ts:55
A live channel transport. Implementations: SlackSource, DiscordSource, …;
InMemoryChannelSource is the test/example fake.
Methods
send()
send(target, text): void | Promise<void>;Defined in: channels/channel-source.types.ts:72
Post reply text back to a channel/thread.
Parameters
| Parameter | Type | Description |
|---|---|---|
target | OutboundTarget | Where the reply goes. |
text | string | The reply text. |
Returns
void | Promise<void>
start()
start(onMessage): void | Promise<void>;Defined in: channels/channel-source.types.ts:64
Begin receiving. onMessage is invoked for every normalized inbound message
— the source must drain and ack its transport continuously and never stop
reading just because a run is in flight (that is what the bounded queue
downstream is for). Owns its own reconnect/heartbeat internally.
Parameters
| Parameter | Type | Description |
|---|---|---|
onMessage | (message) => void | Called per normalized inbound message. |
Returns
void | Promise<void>
stop()
stop(): void | Promise<void>;Defined in: channels/channel-source.types.ts:75
Stop receiving and release the transport.
Returns
void | Promise<void>