• Return a list of chats

    Parameters

    Returns Promise<ChatModel[]>

    Example

    // All chats
    const chats = await WPP.chat.list();

    // Some chats
    const chats = WPP.chat.list({count: 20});

    // 20 chats before specific chat
    const chats = WPP.chat.list({count: 20, direction: 'before', id: '[number]@c.us'});

    // Only users chats
    const chats = await WPP.chat.list({onlyUsers: true});

    // Only groups chats
    const chats = await WPP.chat.list({onlyGroups: true});

    // Only communities chats
    const chats = await WPP.chat.list({onlyCommunities: true});

    // Only Newsletter
    const chats = await WPP.chat.list({onlyNewsletter: true});

    // Only with label Text
    const chats = await WPP.chat.list({withLabels: ['Test']});

    // Only with label id
    const chats = await WPP.chat.list({withLabels: ['1']});

    // Only with label with one of text or id
    const chats = await WPP.chat.list({withLabels: ['Alfa','5']});