Skip to main content

format

type format = "text" | "markdown";

Controls the format of the messages displayed by the ChatBot widget. The default value is "text".

Example of usage

To initialize the ChatBot widget with plain text format:

const chat = new ChatBot(node, { format: "text" });

To initialize the ChatBot widget with markdown format:

const chat = new ChatBot(node, { format: "markdown" });

Changing the message format

To change the message format to plain text after initialization:

chat.setConfig({ format: "text" });

To change the message format to markdown after initialization:

chat.setConfig({ format: "markdown" });

Accessing the current state of the format property

To get the current format state of the ChatBot widget:

const format = chat.getConfig().format;