Conversation
ref / conversations / Conversation
This should be the first parameter in your conversation builder function.
This object gives you access to your conversation. You can think of it as a handle which lets you perform basic operations in your conversation, such as waiting for new messages.
Typically, a conversation builder function has this signature:
ts
async function greet(conversation: Conversation<MyContext>, ctx: MyContext) {
// define your conversation here
}
It may be helpful to define a type alias.
ts
type MyConversation = Conversation<MyContext>
async function greet(conversation: MyConversation, ctx: MyContext) {
// define your conversation here
}
Check out the documentation to learn more about how to create conversations.
Type Parameters
C
ts
C extends Context
Type
ts
ConversationHandle<C>