igpapi — Instagram private API Simulator for Node.js (API reference) 4.14.0
    Preparing search index...

    Interface DirectRecipientPickerActions

    The actions of DirectRecipientPickerScreen: the methods you call on its handle while the screen is open.

    interface DirectRecipientPickerActions {
        createGroup: (
            ...args: [
                rows: readonly { full_name: string; pk: string; username: string }[],
            ],
        ) => Effect<
            AssembledHandle<
                "DirectThread",
                "screen",
                {
                    media: readonly (
                        | {
                            height: number;
                            media_type: 1;
                            pk: string;
                            url: string;
                            width: number;
                        }
                        | {
                            height: number;
                            media_type: 2;
                            pk: string;
                            url: string;
                            width: number;
                        }
                        | {
                            media_type: 8;
                            pk: string;
                            slides: readonly { media_type: 1
                            | 2; pk: string; url: string }[];
                        }
                    )[];
                    messages: readonly {
                        client_context?: string;
                        command_count?: number;
                        edit_count?: number;
                        item_id: string;
                        item_type: string;
                        media?: | {
                            height: number;
                            media_type: 1;
                            pk: string;
                            url: string;
                            width: number;
                        }
                        | {
                            height: number;
                            media_type: 2;
                            pk: string;
                            url: string;
                            width: number;
                        }
                        | {
                            media_type: 8;
                            pk: string;
                            slides: readonly {
                                media_type: (...)
                                | (...);
                                pk: string;
                                url: string;
                            }[];
                        };
                        message_ephemeral_lifetime_ms?: string;
                        text?: string;
                        timestamp: string;
                        user_id: string;
                    }[];
                    thread: {
                        is_group: boolean;
                        muted?: boolean;
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    };
                    users: readonly {
                        fbid_v2?: string;
                        full_name: string;
                        pk: string;
                        username: string;
                    }[];
                },
                DirectThreadActions,
                DirectThreadItems,
                ScreenHandle,
                "required",
                true,
                never,
                AndroidScreens,
            >,
            | IgApiError
            | RequestError
            | ParseError
            | TransportError
            | ScreenEnterConcurrentError
            | ScreenDataError
            | ScreenEdgeInputError
            | DirectInboxSeqIdUnknownError
            | DirectThreadNotFoundByParticipantsError,
            never,
        >;
        search: <Self extends ScreenHandle>(
            this: Self,
            ...args: [query: string],
        ) => Effect<
            {
                raw: ActionRaw;
                recipients: readonly ScreenListItem<
                    {
                        at: "recipients";
                        item: ScreenItemDefinition<
                            "DirectRecipient",
                            { full_name: string; pk: string; username: string },
                            { full_name: string; pk: string; username: string },
                            { userId: string },
                            never,
                            never,
                            DirectRecipientItemActions,
                            undefined,
                            never,
                            never,
                        >;
                        key: "pk";
                        source: ScreenItemNodes;
                    },
                    Self,
                >[];
                threads: readonly ScreenListItem<
                    {
                        at: "threads";
                        item: ScreenItemDefinition<
                            "DirectPickerThread",
                            {
                                is_group: boolean;
                                muted?: boolean;
                                preview: readonly {
                                    client_context?: (...)
                                    | (...);
                                    command_count?: (...) | (...);
                                    edit_count?: (...) | (...);
                                    item_id: string;
                                    item_type: string;
                                    media?: (...) | (...) | (...) | (...);
                                    message_ephemeral_lifetime_ms?: (...) | (...);
                                    text?: (...) | (...);
                                    timestamp: string;
                                    user_id: string;
                                }[];
                                thread_id: string;
                                thread_title: string;
                                thread_v2_id?: string;
                                users: readonly {
                                    fbid_v2?: (...)
                                    | (...);
                                    full_name: string;
                                    pk: string;
                                    username: string;
                                }[];
                            },
                            {
                                is_group: boolean;
                                muted?: boolean;
                                preview: readonly {
                                    client_context?: (...)
                                    | (...);
                                    command_count?: (...) | (...);
                                    edit_count?: (...) | (...);
                                    item_id: string;
                                    item_type: string;
                                    media?: (...) | (...) | (...) | (...);
                                    message_ephemeral_lifetime_ms?: (...) | (...);
                                    text?: (...) | (...);
                                    timestamp: string;
                                    user_id: string;
                                }[];
                                thread_id: string;
                                thread_title: string;
                                thread_v2_id?: string;
                                users: readonly {
                                    fbid_v2?: (...)
                                    | (...);
                                    full_name: string;
                                    pk: string;
                                    username: string;
                                }[];
                            },
                            {
                                thread: {
                                    is_group: boolean;
                                    muted?: boolean;
                                    preview: readonly {
                                        client_context?: ...;
                                        command_count?: ...;
                                        edit_count?: ...;
                                        item_id: ...;
                                        item_type: ...;
                                        media?: ...;
                                        message_ephemeral_lifetime_ms?: ...;
                                        text?: ...;
                                        timestamp: ...;
                                        user_id: ...;
                                    }[];
                                    thread_id: string;
                                    thread_title: string;
                                    thread_v2_id?: string;
                                    users: readonly {
                                        fbid_v2?: ...;
                                        full_name: ...;
                                        pk: ...;
                                        username: ...;
                                    }[];
                                };
                            },
                            never,
                            never,
                            DirectPickerThreadItemActions,
                            undefined,
                            never,
                            never,
                        >;
                        key: "thread_id";
                        source: ScreenItemNodes;
                    },
                    Self,
                >[];
            },
            | IgApiError
            | RequestError
            | ParseError
            | TransportError
            | ScreenEnterConcurrentError
            | ScreenDataError,
            never,
        >;
        startGroupChat: (
            ...args: [],
        ) => Effect<
            AssembledHandle<
                "DirectRecipientPicker",
                "screen",
                {
                    recipients: readonly {
                        full_name: string;
                        pk: string;
                        username: string;
                    }[];
                    searchSessionId: string;
                    threads: readonly {
                        is_group: boolean;
                        muted?: boolean;
                        preview: readonly {
                            client_context?: string;
                            command_count?: number;
                            edit_count?: number;
                            item_id: string;
                            item_type: string;
                            media?: | {
                                height: number;
                                media_type: 1;
                                pk: string;
                                url: string;
                                width: number;
                            }
                            | {
                                height: number;
                                media_type: 2;
                                pk: string;
                                url: string;
                                width: number;
                            }
                            | { media_type: 8; pk: string; slides: readonly (...)[] };
                            message_ephemeral_lifetime_ms?: string;
                            text?: string;
                            timestamp: string;
                            user_id: string;
                        }[];
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                        users: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                    }[];
                },
                DirectRecipientPickerActions,
                DirectRecipientPickerItems,
                ScreenHandle,
                "required",
                true,
                never,
                AndroidScreens,
            >,
            | IgCheckpointError
            | IgAccountSuspendedError
            | IgAccountDisabledError
            | IgLoginRequiredError
            | IgUserLoggedOutError
            | ScreenEnterConcurrentError
            | ScreenDataError
            | ScreenEdgeInputError,
            never,
        >;
    }
    Index

    Properties

    createGroup: (
        ...args: [
            rows: readonly { full_name: string; pk: string; username: string }[],
        ],
    ) => Effect<
        AssembledHandle<
            "DirectThread",
            "screen",
            {
                media: readonly (
                    | {
                        height: number;
                        media_type: 1;
                        pk: string;
                        url: string;
                        width: number;
                    }
                    | {
                        height: number;
                        media_type: 2;
                        pk: string;
                        url: string;
                        width: number;
                    }
                    | {
                        media_type: 8;
                        pk: string;
                        slides: readonly { media_type: 1
                        | 2; pk: string; url: string }[];
                    }
                )[];
                messages: readonly {
                    client_context?: string;
                    command_count?: number;
                    edit_count?: number;
                    item_id: string;
                    item_type: string;
                    media?: | {
                        height: number;
                        media_type: 1;
                        pk: string;
                        url: string;
                        width: number;
                    }
                    | {
                        height: number;
                        media_type: 2;
                        pk: string;
                        url: string;
                        width: number;
                    }
                    | {
                        media_type: 8;
                        pk: string;
                        slides: readonly { media_type: (...)
                        | (...); pk: string; url: string }[];
                    };
                    message_ephemeral_lifetime_ms?: string;
                    text?: string;
                    timestamp: string;
                    user_id: string;
                }[];
                thread: {
                    is_group: boolean;
                    muted?: boolean;
                    thread_id: string;
                    thread_title: string;
                    thread_v2_id?: string;
                };
                users: readonly {
                    fbid_v2?: string;
                    full_name: string;
                    pk: string;
                    username: string;
                }[];
            },
            DirectThreadActions,
            DirectThreadItems,
            ScreenHandle,
            "required",
            true,
            never,
            AndroidScreens,
        >,
        | IgApiError
        | RequestError
        | ParseError
        | TransportError
        | ScreenEnterConcurrentError
        | ScreenDataError
        | ScreenEdgeInputError
        | DirectInboxSeqIdUnknownError
        | DirectThreadNotFoundByParticipantsError,
        never,
    >

    Taps Create with the people you picked (rows, in the order you picked them): creates the group chat. Answers the new thread's handle. Fails with DirectInboxSeqIdUnknownError when the session has not read the inbox yet.

    search: <Self extends ScreenHandle>(
        this: Self,
        ...args: [query: string],
    ) => Effect<
        {
            raw: ActionRaw;
            recipients: readonly ScreenListItem<
                {
                    at: "recipients";
                    item: ScreenItemDefinition<
                        "DirectRecipient",
                        { full_name: string; pk: string; username: string },
                        { full_name: string; pk: string; username: string },
                        { userId: string },
                        never,
                        never,
                        DirectRecipientItemActions,
                        undefined,
                        never,
                        never,
                    >;
                    key: "pk";
                    source: ScreenItemNodes;
                },
                Self,
            >[];
            threads: readonly ScreenListItem<
                {
                    at: "threads";
                    item: ScreenItemDefinition<
                        "DirectPickerThread",
                        {
                            is_group: boolean;
                            muted?: boolean;
                            preview: readonly {
                                client_context?: (...)
                                | (...);
                                command_count?: (...) | (...);
                                edit_count?: (...) | (...);
                                item_id: string;
                                item_type: string;
                                media?: (...) | (...) | (...) | (...);
                                message_ephemeral_lifetime_ms?: (...) | (...);
                                text?: (...) | (...);
                                timestamp: string;
                                user_id: string;
                            }[];
                            thread_id: string;
                            thread_title: string;
                            thread_v2_id?: string;
                            users: readonly {
                                fbid_v2?: (...)
                                | (...);
                                full_name: string;
                                pk: string;
                                username: string;
                            }[];
                        },
                        {
                            is_group: boolean;
                            muted?: boolean;
                            preview: readonly {
                                client_context?: (...)
                                | (...);
                                command_count?: (...) | (...);
                                edit_count?: (...) | (...);
                                item_id: string;
                                item_type: string;
                                media?: (...) | (...) | (...) | (...);
                                message_ephemeral_lifetime_ms?: (...) | (...);
                                text?: (...) | (...);
                                timestamp: string;
                                user_id: string;
                            }[];
                            thread_id: string;
                            thread_title: string;
                            thread_v2_id?: string;
                            users: readonly {
                                fbid_v2?: (...)
                                | (...);
                                full_name: string;
                                pk: string;
                                username: string;
                            }[];
                        },
                        {
                            thread: {
                                is_group: boolean;
                                muted?: boolean;
                                preview: readonly {
                                    client_context?: ...;
                                    command_count?: ...;
                                    edit_count?: ...;
                                    item_id: ...;
                                    item_type: ...;
                                    media?: ...;
                                    message_ephemeral_lifetime_ms?: ...;
                                    text?: ...;
                                    timestamp: ...;
                                    user_id: ...;
                                }[];
                                thread_id: string;
                                thread_title: string;
                                thread_v2_id?: string;
                                users: readonly {
                                    fbid_v2?: ...;
                                    full_name: ...;
                                    pk: ...;
                                    username: ...;
                                }[];
                            };
                        },
                        never,
                        never,
                        DirectPickerThreadItemActions,
                        undefined,
                        never,
                        never,
                    >;
                    key: "thread_id";
                    source: ScreenItemNodes;
                },
                Self,
            >[];
        },
        | IgApiError
        | RequestError
        | ParseError
        | TransportError
        | ScreenEnterConcurrentError
        | ScreenDataError,
        never,
    >

    Types in the search field (query): looks up people and, in the one-to-one picker, existing threads. Answers fresh item handles for both lists, recipients and threads; an answer without results holds empty lists.

    startGroupChat: (
        ...args: [],
    ) => Effect<
        AssembledHandle<
            "DirectRecipientPicker",
            "screen",
            {
                recipients: readonly {
                    full_name: string;
                    pk: string;
                    username: string;
                }[];
                searchSessionId: string;
                threads: readonly {
                    is_group: boolean;
                    muted?: boolean;
                    preview: readonly {
                        client_context?: string;
                        command_count?: number;
                        edit_count?: number;
                        item_id: string;
                        item_type: string;
                        media?: | {
                            height: number;
                            media_type: 1;
                            pk: string;
                            url: string;
                            width: number;
                        }
                        | {
                            height: number;
                            media_type: 2;
                            pk: string;
                            url: string;
                            width: number;
                        }
                        | { media_type: 8; pk: string; slides: readonly (...)[] };
                        message_ephemeral_lifetime_ms?: string;
                        text?: string;
                        timestamp: string;
                        user_id: string;
                    }[];
                    thread_id: string;
                    thread_title: string;
                    thread_v2_id?: string;
                    users: readonly {
                        fbid_v2?: string;
                        full_name: string;
                        pk: string;
                        username: string;
                    }[];
                }[];
            },
            DirectRecipientPickerActions,
            DirectRecipientPickerItems,
            ScreenHandle,
            "required",
            true,
            never,
            AndroidScreens,
        >,
        | IgCheckpointError
        | IgAccountSuspendedError
        | IgAccountDisabledError
        | IgLoginRequiredError
        | IgUserLoggedOutError
        | ScreenEnterConcurrentError
        | ScreenDataError
        | ScreenEdgeInputError,
        never,
    >

    Taps the Group chat row and opens the picker again in group mode. Answers that picker's handle, which offers createGroup().