From 056343cf5cad720e7d047b93a66070a2a767ef95 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Tue, 15 Mar 2022 23:55:30 +0000 Subject: [PATCH] fix: temp fix for resharding options --- gateway/resharder.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gateway/resharder.ts b/gateway/resharder.ts index 13013c6ed..7f806780f 100644 --- a/gateway/resharder.ts +++ b/gateway/resharder.ts @@ -13,7 +13,7 @@ export async function resharder( ...oldGateway, }); - for (const key of Object.keys(oldGateway)) { + for (const [key, value] of Object.entries(oldGateway)) { if (key === "handleDiscordPayload") { gateway.handleDiscordPayload = async function (_, data, shardId) { if (data.t === "READY") { @@ -24,8 +24,9 @@ export async function resharder( continue; } - // USE ANY CUSTOMIZED HANDLERS FROM OLD GATEWAY - if (typeof key === "function") gateway[key] = oldGateway[key]; + // USE ANY CUSTOMIZED OPTIONS FROM OLD GATEWAY + // @ts-ignore TODO: fix this dynamica assignment + gateway[key] = oldGateway[key as keyof typeof oldGateway]; } // Begin resharding