mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-29 09:02:02 +03:00
Fix: check cleanups
This commit is contained in:
@@ -72,20 +72,15 @@ function createDiscordGatewayPlugin(params: {
|
|||||||
return new GatewayPlugin(options);
|
return new GatewayPlugin(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
let agent: HttpsProxyAgent | undefined;
|
|
||||||
try {
|
try {
|
||||||
agent = new HttpsProxyAgent(proxy);
|
const agent = new HttpsProxyAgent<string>(proxy);
|
||||||
} catch (err) {
|
|
||||||
params.runtime.error?.(danger(`discord: invalid gateway proxy: ${String(err)}`));
|
|
||||||
return new GatewayPlugin(options);
|
|
||||||
}
|
|
||||||
|
|
||||||
params.runtime.log?.("discord: gateway proxy enabled");
|
params.runtime.log?.("discord: gateway proxy enabled");
|
||||||
|
|
||||||
class ProxyGatewayPlugin extends GatewayPlugin {
|
class ProxyGatewayPlugin extends GatewayPlugin {
|
||||||
#proxyAgent: HttpsProxyAgent;
|
#proxyAgent: HttpsProxyAgent<string>;
|
||||||
|
|
||||||
constructor(proxyAgent: HttpsProxyAgent) {
|
constructor(proxyAgent: HttpsProxyAgent<string>) {
|
||||||
super(options);
|
super(options);
|
||||||
this.#proxyAgent = proxyAgent;
|
this.#proxyAgent = proxyAgent;
|
||||||
}
|
}
|
||||||
@@ -99,6 +94,10 @@ function createDiscordGatewayPlugin(params: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new ProxyGatewayPlugin(agent);
|
return new ProxyGatewayPlugin(agent);
|
||||||
|
} catch (err) {
|
||||||
|
params.runtime.error?.(danger(`discord: invalid gateway proxy: ${String(err)}`));
|
||||||
|
return new GatewayPlugin(options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function summarizeAllowList(list?: Array<string | number>) {
|
function summarizeAllowList(list?: Array<string | number>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user