@ -1,6 +1,6 @@
|
||||
import prisma from '@typebot.io/lib/prisma'
|
||||
import {
|
||||
ChatReply,
|
||||
ContinueChatResponse,
|
||||
PublicTypebot,
|
||||
SessionState,
|
||||
Settings,
|
||||
@ -20,7 +20,7 @@ import { VisitedEdge } from '@typebot.io/prisma'
|
||||
|
||||
type Props = {
|
||||
incomingMessage?: string
|
||||
workspaceId?: string
|
||||
workspaceId: string
|
||||
credentials: WhatsAppCredentials['data'] & Pick<WhatsAppCredentials, 'id'>
|
||||
contact: NonNullable<SessionState['whatsApp']>['contact']
|
||||
}
|
||||
@ -31,7 +31,7 @@ export const startWhatsAppSession = async ({
|
||||
credentials,
|
||||
contact,
|
||||
}: Props): Promise<
|
||||
| (ChatReply & {
|
||||
| (ContinueChatResponse & {
|
||||
newSessionState: SessionState
|
||||
visitedEdges: VisitedEdge[]
|
||||
})
|
||||
@ -89,9 +89,10 @@ export const startWhatsAppSession = async ({
|
||||
version: 2,
|
||||
message: incomingMessage,
|
||||
startParams: {
|
||||
typebot: publicTypebot.typebot.publicId as string,
|
||||
type: 'live',
|
||||
publicId: publicTypebot.typebot.publicId as string,
|
||||
isOnlyRegistering: false,
|
||||
},
|
||||
userId: undefined,
|
||||
initialSessionState: {
|
||||
whatsApp: {
|
||||
contact,
|
||||
|
Reference in New Issue
Block a user