Channel interface represents a channel or conversation container that can hold multiple threads. It provides methods for posting messages, iterating threads and messages, and managing channel-level state.
Properties
id
{adapter}:{channelId}
Examples:
- Slack:
slack:C123ABC - Teams:
teams:{base64(conversationId)} - Google Chat:
gchat:spaces/ABC123
adapter
isDM
name
fetchMetadata() is called.
state
messages
This returns top-level channel messages, NOT thread replies. For threaded platforms like Slack, this returns messages posted to the channel directly (not in threads).
Methods
post()
string | PostableMessage | CardJSXElement
required
Message content to post
SentMessage
A SentMessage with methods to edit, delete, or add reactions
Streaming at the channel level accumulates all chunks before posting as a single message, since channel-level streaming is not typically supported.
postEphemeral()
string | Author
required
User ID string or Author object (from message.author or event.user)
AdapterPostableMessage | CardJSXElement
required
Message content (string, markdown, card, etc.)
PostEphemeralOptions
required
EphemeralMessage | null
EphemeralMessage with
usedFallback: true if DM was used, or null if unsupported and fallbackToDM is falsesetState()
Partial<TState>
required
State object to set (will be merged with existing state unless replace: true)
object
startTyping()
string
Optional status text shown where supported
fetchMetadata()
ChannelInfo
Channel metadata object
threads()
ThreadSummary objects for efficiency.
Returns an empty iterable on threadless platforms (platforms that don’t support threaded conversations).
AsyncIterable<ThreadSummary>
Async iterable of thread summaries
mentionUser()
string
required
Platform-specific user ID
string
Formatted mention string (e.g.,
<@U123>)Type Parameters
object
default:"Record<string, unknown>"
Custom state type stored per-channel
unknown
default:"unknown"
Platform-specific raw message type
Usage Examples
Channel Announcements
Welcome New Members
List Active Threads
Slash Command Response
Channel State Management
See Also
- Chat API - Main Chat class
- Thread API - Thread interface
- Message API - Message structure
- Slash Commands - Handling slash commands