Skip to main content

Editing Chat Messages

As mentioned in introduction, there are 3 types of chat messages - text messages, images, and files. There is a method in to edit a message of each type.

Edit a text message

To edit a text message, the method can be used. This accepts a messageId (type string) and a message (type string).

const message =[0];
const messageId = message?.id;
const newMessage = 'Is this the real life?';
await;, newMessage);

Here's how you would use the editMessage() method to edit a text message.

const messageId = '...';
const message = 'Is this just fantasy?';
await, { type: 'text', message });