fix: temp fix for resharding options

This commit is contained in:
Skillz4Killz
2022-03-15 23:55:30 +00:00
committed by GitHub
parent 186067350d
commit 056343cf5c
+4 -3
View File
@@ -13,7 +13,7 @@ export async function resharder(
...oldGateway, ...oldGateway,
}); });
for (const key of Object.keys(oldGateway)) { for (const [key, value] of Object.entries(oldGateway)) {
if (key === "handleDiscordPayload") { if (key === "handleDiscordPayload") {
gateway.handleDiscordPayload = async function (_, data, shardId) { gateway.handleDiscordPayload = async function (_, data, shardId) {
if (data.t === "READY") { if (data.t === "READY") {
@@ -24,8 +24,9 @@ export async function resharder(
continue; continue;
} }
// USE ANY CUSTOMIZED HANDLERS FROM OLD GATEWAY // USE ANY CUSTOMIZED OPTIONS FROM OLD GATEWAY
if (typeof key === "function") gateway[key] = oldGateway[key]; // @ts-ignore TODO: fix this dynamica assignment
gateway[key] = oldGateway[key as keyof typeof oldGateway];
} }
// Begin resharding // Begin resharding