mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:58:26 +00:00
Discord: add gateway proxy docs and tests (#10400) (thanks @winter-loo)
This commit is contained in:
@@ -85,10 +85,7 @@ function createDiscordGatewayPlugin(params: {
|
||||
this.#proxyAgent = proxyAgent;
|
||||
}
|
||||
|
||||
createWebSocket(url?: string) {
|
||||
if (!url) {
|
||||
throw new Error("Gateway URL is required");
|
||||
}
|
||||
createWebSocket(url: string) {
|
||||
return new WebSocket(url, { agent: this.#proxyAgent });
|
||||
}
|
||||
}
|
||||
@@ -753,3 +750,7 @@ async function clearDiscordNativeCommands(params: {
|
||||
params.runtime.error?.(danger(`discord: failed to clear native commands: ${String(err)}`));
|
||||
}
|
||||
}
|
||||
|
||||
export const __testing = {
|
||||
createDiscordGatewayPlugin,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user