Skip to content

Commit

Permalink
fix(reloading commands): Remove command deletion in code snippet (#1549)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamerkuipers authored May 26, 2024
1 parent 88764cf commit d6f9b5c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions guide/additional-features/reloading-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ In theory, all there is to do is delete the previous command from `client.comman
delete require.cache[require.resolve(`./${command.data.name}.js`)];

try {
interaction.client.commands.delete(command.data.name);
const newCommand = require(`./${command.data.name}.js`);
interaction.client.commands.set(newCommand.data.name, newCommand);
await interaction.reply(`Command \`${newCommand.data.name}\` was reloaded!`);
Expand All @@ -69,4 +68,4 @@ The snippet above uses a `try...catch` block to load the command file and add it

## Resulting code

<ResultingCode path="additional-features/reloading-commands" />
<ResultingCode path="additional-features/reloading-commands" />

0 comments on commit d6f9b5c

Please sign in to comment.