Ephemeral Messages
Ephemeral messages are visible only to a specific user within a thread. They're useful for confirmations, hints, and private notifications.
Send an ephemeral message
The fallbackToDM option is required. It controls what happens on platforms without native ephemeral support:
fallbackToDM: true: send the message as a DM instead. If the adapter can't open DMs either, nothing is sent and the call returnsnull.fallbackToDM: false: don't send anything, and returnnull.
Platform behavior
| Platform | Native support | Behavior | Persistence |
|---|---|---|---|
| Slack | Yes | Ephemeral in channel | Session-only (disappears on reload) |
| Google Chat | Yes | Private message in space | Persists until deleted |
| Teams | Yes | Targeted message in conversation | Teams-managed |
| Discord | No | DM fallback | Persists in DM |
Discord slash command responses can be made ephemeral with the Discord adapter's interactionFlags option. Outside that interaction flow, postEphemeral still follows the fallback behavior.
Check for fallback
Graceful degradation
To send only when the platform supports native ephemeral messages, set fallbackToDM to false and check for null:
Ephemeral cards
Cards work with ephemeral messages too:
Read more
Direct Messages
Initiate DM conversations with users programmatically.
Creating a Chat Instance
Initialize the Chat class with adapters, state, and configuration options.
File Uploads
Send and receive files across chat platforms.
History
Store and retrieve message history across user, thread, and channel scopes.