thread.subscribe().
This includes:
- Follow-up messages from users
- Messages that @-mention the bot (check
message.isMention)
- The message that triggered the subscription (e.g., the initial @mention)
- Messages sent by the bot itself
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Handler for messages in subscribed threads.
thread.subscribe().
This includes:
message.isMention)chat.onSubscribedMessage(async (thread, message) => {
// Handle all follow-up messages
if (message.isMention) {
// User @-mentioned us in a subscribed thread
}
await thread.post(`Got your message: ${message.text}`);
});
type SubscribedMessageHandler = (thread: Thread<TState>, message: Message, context: MessageContext) => void | Promise<void>
Was this page helpful?