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[];
    };
    group.join-request: {
        action: RequestJoinAction;
        author: string;
        id: string;
        method: RequestJoinMethod;
        participant: 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[];
        requestId?: string;
        type: MessageUpsertType;
    };
    messaging-history.set: {
        chats: Chat[];
        contacts: Contact[];
        isLatest?: boolean;
        messages: WAMessage[];
        peerDataRequestSessionId?: string | null;
        progress?: number | null;
        syncType?: proto.HistorySync.HistorySyncType;
    };
    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

  • group.join-request: {
        action: RequestJoinAction;
        author: string;
        id: string;
        method: RequestJoinMethod;
        participant: string;
    }
  • 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[];
        requestId?: string;
        type: MessageUpsertType;
    }

    add/update the given messages. If they were received while the connection was online, the update will have type: "notify" if requestId is provided, then the messages was received from the phone due to it being unavailable

  • messaging-history.set: {
        chats: Chat[];
        contacts: Contact[];
        isLatest?: boolean;
        messages: WAMessage[];
        peerDataRequestSessionId?: string | null;
        progress?: number | null;
        syncType?: proto.HistorySync.HistorySyncType;
    }

    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