Skip to main content

append_message


name: append-message (intercept) description: event to block text addition to existing message ---# append-message

chat.on("append-message", ({ id: TID, content: string }) => {
console.log("append ", content, "to message", id);
});

Use this event to detect that some text was added to an existing message. This can help in logging, analytics, or triggering other actions when the message content is dynamically updated.

detect that some text was added to the existing message

chat.on("append-message", ({ id: TID, content: string }) => {
console.log("append ", content, "to message", id);
});

Monitor changes to messages and track updates when new text is appended. Useful for maintaining an audit trail or triggering notifications for message updates.

append-message (intercept)

chat.intercept("append-message", ({ id: TID, content: string }) => {
// Prevent the text from being appended to the message
return false;
});

Use this event to block appending text to the existing message. This can be used to enforce message content rules or validation before allowing updates to messages.

how to block appending text to the existing message

chat.intercept("append-message", ({ id: TID, content: string }) => {
// Prevent the text from being appended to the message
return false;
});

Prevent new text from being added to messages based on specific criteria or conditions, ensuring message integrity and compliance with business rules.