Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
fix(client): change to application commands
Browse files Browse the repository at this point in the history
Changed route from `applicationGuildCommands` to `applicationCommands` and removed
`process.env.GUILD_ID` parameter to register commands globally when bot goes online.
  • Loading branch information
mahyarmirrashed committed Aug 29, 2021
1 parent 0302856 commit 0f95829
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,9 @@ export default class Bot extends Client {
// report slash commands to Discord API
new REST({ version: '9' })
.setToken(process.env.DISCORD_TOKEN as string)
.put(
Routes.applicationGuildCommands(
process.env.CLIENT_ID as string,
process.env.GUILD_ID as string,
),
{
body: slashCommands,
},
)
.put(Routes.applicationCommands(process.env.CLIENT_ID as string), {
body: slashCommands,
})
.then(() =>
this.logger.success(
'Successfully registered all application commands!',
Expand Down

0 comments on commit 0f95829

Please sign in to comment.