typeMessage
typeMessage(params: { id: string, mode: number }): void;
The typeMessage
method changes the typing state for a given message. This method takes an object with two properties: id
and mode
.
id
: The unique identifier for the message.mode
: Represents the typing state. Accepts 1 for "typing" and 0 for "not typing."
Use-cases
Set Typing State to Typing
To indicate that a message is currently being typed, use the following snippet:
chat.typeMessage({ id: TID, mode: 1 });
console.log("Typing state changed to 1 for message", TID);
Set Typing State to Not Typing
To indicate that typing has stopped for a message, use the following snippet:
chat.typeMessage({ id: TID, mode: 0 });
console.log("Typing state changed to 0 for message", TID);