Skip to main content

type-message

(chat: ChatWidget) => void
chat.on("type-message", ({ id: TID, mode: number }) => {
console.log("for message ", id, "typing state changed to", mode);
});

This event is triggered when the typing state changes for a specific message. The id parameter represents the unique identifier of the message, while the mode parameter indicates the new typing state (e.g., started typing, stopped typing). It should be used when it is necessary to perform actions based on the changes in the typing state of messages, such as logging these changes, triggering UI updates, or integrating with other systems.

detect that typing state is changed for the message

chat.on("type-message", ({ id: TID, mode: number }) => {
console.log("for message ", id, "typing state changed to", mode);
});

This use-case involves detecting and handling the change in the typing state for a message. For example, this can be useful for logging purposes or for updating the UI to reflect the current typing state of the message sender.

How to block typing state change for the message

chat.intercept("type-message", ({ id: TID, mode: number }) => {
return false;
});

This use-case involves intercepting and blocking the typing state change for a specific message. This can be necessary in scenarios where the typing state should not be altered, for example, if there are restrictions or conditions that must be met before allowing the typing state to change.