@karmaniverous/jeeves-scripts-core
    Preparing search index...

    Interface SlackClient

    The Slack Web API calls core and instances use.

    interface SlackClient {
        call: (
            method: string,
            params?: Record<string, string>,
        ) => Promise<SlackResponse>;
        download: (url: string) => Promise<Response>;
        openDm: (userId: string) => Promise<string>;
        post: (
            method: string,
            body: Record<string, unknown>,
        ) => Promise<SlackResponse>;
        postMessage: (
            channel: string,
            text: string,
            options?: SlackPostMessageOptions,
        ) => Promise<SlackPostedMessage>;
        uploadFile: (file: SlackFileUpload) => Promise<string>;
    }
    Index
    call: (
        method: string,
        params?: Record<string, string>,
    ) => Promise<SlackResponse>

    GET a Web API method with query parameters (read methods: conversations.history, auth.test, …).

    download: (url: string) => Promise<Response>

    GET a file URL (url_private_download) with the token; resolves the raw response.

    openDm: (userId: string) => Promise<string>

    Open (or reuse) the token's DM with userId (conversations.open); resolves the channel id.

    post

    post: (method: string, body: Record<string, unknown>) => Promise<SlackResponse>

    POST a JSON body to a Web API method.

    postMessage: (
        channel: string,
        text: string,
        options?: SlackPostMessageOptions,
    ) => Promise<SlackPostedMessage>

    Post text to a channel, DM or thread (chat.postMessage); resolves the message's channel and ts.

    uploadFile: (file: SlackFileUpload) => Promise<string>

    Upload and share a file: files.getUploadURLExternal, POST the bytes (an HTTP error throws "Slack file upload failed: HTTP status for filename"), files.completeUploadExternal. Resolves the file id.