@prass/botpress-native
Version:
A simple and powerful SDK for integrating Botpress Chat API with React Native,
19 lines (18 loc) • 1.15 kB
TypeScript
import { CreateConversationParams } from "../../types/botpress";
import { Botpress } from "../Botpress";
import { CreateConversationResponse } from "../../types/botpress.response";
/**
* Handles the logic to create a new conversation with the specified ID.
*
* This function sends a POST request to the Botpress API to create a new conversation. It checks for
* the presence of both the user key (to ensure that the user has been created) and the conversation ID
* before proceeding with the creation request.
*
* @param this - The Botpress class instance, providing access to class properties like `ChatApiBaseUrl` and `userKey`.
* @param {DeleteConversationParams} params - The parameters containing the conversation ID.
* @param {string} params.id - The unique identifier for the conversation to create.
*
* @returns {Promise<void>} Resolves when the conversation has been successfully created.
* @throws {Exception} If the request fails, throws a custom exception with relevant error details.
*/
export declare function handleCreateConversation(this: Botpress, { id }: CreateConversationParams): Promise<CreateConversationResponse>;