From dd21a5abad560f3d00b8c58912786d4b6bd520e9 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Sat, 10 Aug 2024 22:29:36 +0700 Subject: [PATCH] fix(bots/discord): provide discord token for `reload` command --- bots/discord/src/commands/admin/reload.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bots/discord/src/commands/admin/reload.ts b/bots/discord/src/commands/admin/reload.ts index c8ca185..ada207c 100644 --- a/bots/discord/src/commands/admin/reload.ts +++ b/bots/discord/src/commands/admin/reload.ts @@ -27,7 +27,9 @@ export default new AdminCommand({ logger.info('Reinitializing Discord client to reload configuration...') await discord.client.destroy() - await discord.client.login() + // discord.client.token only gets set whenever a new Client is intialized + // so that's why we need to provide the token here :/ + await discord.client.login(process.env['DISCORD_TOKEN']) // @ts-expect-error: TypeScript dum await trigger[('deferReply' in trigger ? 'editReply' : 'reply')]({ content: 'Reloaded configuration' })