mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-30 15:50:24 +00:00
22 lines
563 B
TypeScript
22 lines
563 B
TypeScript
import { RequestClient, type RequestClientOptions } from "./internal/discord.js";
|
|
|
|
type ProxyRequestClientOptions = RequestClientOptions;
|
|
|
|
export const DISCORD_REST_TIMEOUT_MS = 15_000;
|
|
|
|
export function createDiscordRequestClient(
|
|
token: string,
|
|
options?: ProxyRequestClientOptions,
|
|
): RequestClient {
|
|
if (!options?.fetch) {
|
|
return new RequestClient(token, options);
|
|
}
|
|
return new RequestClient(token, {
|
|
runtimeProfile: "persistent",
|
|
maxQueueSize: 1000,
|
|
timeout: DISCORD_REST_TIMEOUT_MS,
|
|
...options,
|
|
fetch: options.fetch,
|
|
});
|
|
}
|