Skip to content

Commit

Permalink
[Fix] precommands collection not needed anymore thanks to @stho32
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Oct 2, 2021
1 parent b164c4f commit 285f008
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2,028 deletions.
3 changes: 2 additions & 1 deletion config.example.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"token": ""
"token": "",
"prefix": ""
}
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const { Player } = require("discord-player");
const player = new Player(client);
client.player = player;
client.commands = new Collection();
client.precommands = new Collection();
client.logger = logger;

// All commands!
Expand All @@ -31,7 +30,6 @@ for (const folder of allCommandsFolders) {
const command = require(`./commands/${folder}/${file}`);
command.category = folder;
client.commands.set(command.data.name, command);
client.precommands.set(command.name, command);
}
}

Expand Down Expand Up @@ -76,8 +74,8 @@ client.on("messageCreate", async (message) => {
const commandName = args.shift().toLowerCase();

const command =
client.precommands.get(commandName) ||
client.precommands.find(
client.commands.get(commandName) ||
client.commands.find(
(cmd) => cmd.aliases && cmd.aliases.includes(commandName)
);

Expand Down
Loading

0 comments on commit 285f008

Please sign in to comment.