fix: reduce Slack WebClient retries

This commit is contained in:
Peter Steinberger
2026-01-23 06:28:01 +00:00
parent 4912e85ac8
commit 68ea6e521b
11 changed files with 94 additions and 15 deletions

View File

@@ -1,8 +1,9 @@
import { WebClient } from "@slack/web-api";
import type { WebClient } from "@slack/web-api";
import { loadConfig } from "../config/config.js";
import { logVerbose } from "../globals.js";
import { resolveSlackAccount } from "./accounts.js";
import { createSlackWebClient } from "./client.js";
import { sendMessageSlack } from "./send.js";
import { resolveSlackBotToken } from "./token.js";
@@ -56,7 +57,7 @@ function normalizeEmoji(raw: string) {
async function getClient(opts: SlackActionClientOpts = {}) {
const token = resolveToken(opts.token, opts.accountId);
return opts.client ?? new WebClient(token);
return opts.client ?? createSlackWebClient(token);
}
async function resolveBotUserId(client: WebClient) {