We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 591f753 commit 267653fCopy full SHA for 267653f
‎src/plugins/gather.ts‎
@@ -1,6 +1,7 @@
1
import { Game } from "@gathertown/gather-game-client";
2
import dixt, { DixtPlugin, Log, merge } from "dixt";
3
import * as cron from "node-cron";
4
+import WebSocket from "ws";
5
6
const name = "dixt-plugin-gather";
7
@@ -68,6 +69,11 @@ const dixtPluginGather: DixtPlugin<DixtPluginGatherOptions> = (
68
69
}
70
71
client.once("ready", () => {
72
+ // Set WebSocket globally for Node.js environment
73
+ if (typeof global !== "undefined" && !global.WebSocket) {
74
+ global.WebSocket = WebSocket as any;
75
+ }
76
+
77
const formattedSpaceId = spaceId.replace(/\//g, "\\");
78
game = new Game(formattedSpaceId, () => Promise.resolve({ apiKey }));
79
0 commit comments