fix: satisfy discord and gateway typing

This commit is contained in:
Peter Steinberger
2026-01-03 02:52:04 +01:00
parent 3ec5ce8349
commit a9eb31e8fe
2 changed files with 11 additions and 6 deletions

View File

@@ -27,6 +27,7 @@ export async function callGateway<T = unknown>(
const config = loadConfig();
const isRemoteMode = config.gateway?.mode === "remote";
const remote = isRemoteMode ? config.gateway?.remote : undefined;
const authToken = config.gateway?.auth?.token;
const url =
(typeof opts.url === "string" && opts.url.trim().length > 0
? opts.url.trim()
@@ -44,9 +45,8 @@ export async function callGateway<T = unknown>(
? remote.token.trim()
: undefined
: process.env.CLAWDIS_GATEWAY_TOKEN?.trim() ||
(typeof config.gateway?.auth?.token === "string" &&
config.gateway.auth.token.trim().length > 0
? config.gateway.auth.token.trim()
(typeof authToken === "string" && authToken.trim().length > 0
? authToken.trim()
: undefined));
const password =
(typeof opts.password === "string" && opts.password.trim().length > 0