undo

Thu hồi tin nhắn

api.undo(message)

Parameters

  • message UndoPayload

Return

Promise<UndoResponse>

Types

export type UndoPayload = {
    msgId: string | number;
    cliMsgId: string | number;
};

export type UndoResponse = {
    status: number;
};

Examples

// Thu hồi tin nhắn của bản thân nếu nó có chứa từ undo
api.listener.on("message", (message) => {
    const { content } = message.data;
    const isTextMessage = typeof content == "string";
    const shouldUndo = isTextMessage && content.includes("undo");
    if (message.isSelf && shouldUndo) {
        api.undo(message).then(console.log).catch(console.error);
    }
});

Last updated