Type alias BaileysEventMap

BaileysEventMap: {
    blocklist.set: {
        blocklist: string[];
    };
    blocklist.update: {
        blocklist: string[];
        type: "add" | "remove";
    };
    call: WACallEvent[];
    chats.delete: string[];
    chats.phoneNumberShare: {
        jid: string;
        lid: string;
    };
    chats.update: ChatUpdate[];
    chats.upsert: Chat[];
    connection.update: Partial<ConnectionState>;
    contacts.update: Partial<Contact>[];
    contacts.upsert: Contact[];
    creds.update: Partial<AuthenticationCreds>;
    group-participants.update: {
        action: ParticipantAction;
        author: string;
        id: string;
        participants: string[];
    };
    groups.update: Partial<GroupMetadata>[];
    groups.upsert: GroupMetadata[];
    labels.association: {
        association: LabelAssociation;
        type: "add" | "remove";
    };
    labels.edit: Label;
    message-receipt.update: MessageUserReceiptUpdate[];
    messages.delete: {
        keys: WAMessageKey[];
    } | {
        all: true;
        jid: string;
    };
    messages.media-update: {
        error?: Boom;
        key: WAMessageKey;
        media?: {
            ciphertext: Uint8Array;
            iv: Uint8Array;
        };
    }[];
    messages.reaction: {
        key: WAMessageKey;
        reaction: IReaction;
    }[];
    messages.update: WAMessageUpdate[];
    messages.upsert: {
        messages: WAMessage[];
        type: MessageUpsertType;
    };
    messaging-history.set: {
        chats: Chat[];
        contacts: Contact[];
        isLatest: boolean;
        messages: WAMessage[];
    };
    presence.update: {
        id: string;
        presences: {
            [participant: string]: PresenceData;
        };
    };
}

Type declaration

  • blocklist.set: {
        blocklist: string[];
    }
    • blocklist: string[]
  • blocklist.update: {
        blocklist: string[];
        type: "add" | "remove";
    }
    • blocklist: string[]
    • type: "add" | "remove"
  • call: WACallEvent[]

    Receive an update on a call, including when the call was received, rejected, accepted

  • chats.delete: string[]

    delete chats with given ID

  • chats.phoneNumberShare: {
        jid: string;
        lid: string;
    }
    • jid: string
    • lid: string
  • chats.update: ChatUpdate[]

    update the given chats

  • chats.upsert: Chat[]

    upsert chats

  • connection.update: Partial<ConnectionState>

    connection state has been updated -- WS closed, opened, connecting etc.

  • contacts.update: Partial<Contact>[]
  • contacts.upsert: Contact[]
  • creds.update: Partial<AuthenticationCreds>

    credentials updated -- some metadata, keys or something

  • group-participants.update: {
        action: ParticipantAction;
        author: string;
        id: string;
        participants: string[];
    }

    apply an action to participants in a group

  • groups.update: Partial<GroupMetadata>[]
  • groups.upsert: GroupMetadata[]
  • labels.association: {
        association: LabelAssociation;
        type: "add" | "remove";
    }
    • association: LabelAssociation
    • type: "add" | "remove"
  • labels.edit: Label
  • message-receipt.update: MessageUserReceiptUpdate[]
  • messages.delete: {
        keys: WAMessageKey[];
    } | {
        all: true;
        jid: string;
    }
  • messages.media-update: {
        error?: Boom;
        key: WAMessageKey;
        media?: {
            ciphertext: Uint8Array;
            iv: Uint8Array;
        };
    }[]
  • messages.reaction: {
        key: WAMessageKey;
        reaction: IReaction;
    }[]

    message was reacted to. If reaction was removed -- then "reaction.text" will be falsey

  • messages.update: WAMessageUpdate[]
  • messages.upsert: {
        messages: WAMessage[];
        type: MessageUpsertType;
    }

    add/update the given messages. If they were received while the connection was online, the update will have type: "notify"

  • messaging-history.set: {
        chats: Chat[];
        contacts: Contact[];
        isLatest: boolean;
        messages: WAMessage[];
    }

    set chats (history sync), everything is reverse chronologically sorted

  • presence.update: {
        id: string;
        presences: {
            [participant: string]: PresenceData;
        };
    }

    presence of contact in a chat updated

Generated using TypeDoc