Skip to content

Commit

Permalink
fix(bots/discord): provide discord token for reload command
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmDevs committed Aug 10, 2024
1 parent 80aeb19 commit dd21a5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bots/discord/src/commands/admin/reload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down

0 comments on commit dd21a5a

Please sign in to comment.