Discord: add gateway proxy docs and tests (#10400) (thanks @winter-loo)

This commit is contained in:
Shadow
2026-02-13 13:14:19 -06:00
committed by Shadow
parent e55431bf84
commit 5645f227f6
5 changed files with 144 additions and 4 deletions

View File

@@ -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,
};