Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

499 B
Raw Blame
import { WebClient, type WebClientOptions } from "@slack/web-api";

export type SlackWebClientFactory = (token: string, options: WebClientOptions) => Pick<WebClient, "apiCall">;

export function slackWebClient(
  token: string,
  factory: SlackWebClientFactory = (token, options) => new WebClient(token, options),
  timeout = 20_000,
) {
  return factory(token, {
    retryConfig: { retries: 0 },
    rejectRateLimitedCalls: true,
    attachOriginalToWebAPIRequestError: false,
    timeout,
  });
}