Skip to content

Commit

Permalink
fixed loadCommands cause they are not array
Browse files Browse the repository at this point in the history
  • Loading branch information
USERSATOSHI committed May 24, 2024
1 parent 10fc0da commit c8c23fe
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/classes/LoadCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,22 +235,12 @@ class LoadCommands {
for (const cmd of dp.keys) {
try {
if (cmd === "interaction") {
if (Array.isArray(dp.commandsLocation.interaction.slash)) {
dp.commandsLocation.interaction.slash = dp.commandsLocation.interaction.slash.filter((x) => x.load);
}
if (Array.isArray(dp.commandsLocation.interaction.button)) {
dp.commandsLocation.interaction.button = dp.commandsLocation.interaction.button.filter((x) => x.load);
}
if (Array.isArray(dp.commandsLocation.interaction.selectMenu)) {
dp.commandsLocation.interaction.selectMenu = dp.commandsLocation.interaction.selectMenu.filter((x) => x.load);
}
if (Array.isArray(dp.commandsLocation.interaction.modal)) {
dp.commandsLocation.interaction.modal = dp.commandsLocation.interaction.modal.filter((x) => x.load);
}
dp.commandsLocation.interaction.slash = dp.commandsLocation.interaction.slash.filter((x) => !x.load);
dp.commandsLocation.interaction.button = dp.commandsLocation.interaction.button.filter((x) => !x.load);
dp.commandsLocation.interaction.selectMenu = dp.commandsLocation.interaction.selectMenu.filter((x) => !x.load);
dp.commandsLocation.interaction.modal = dp.commandsLocation.interaction.modal.filter((x) => !x.load);
} else {
if (Array.isArray(dp.commandsLocation[cmd])) {
dp.commandsLocation[cmd] = dp.commandsLocation[cmd].filter((x) => x.load);
}
dp.commandsLocation[cmd] = dp.commandsLocation[cmd].filter((x) => !x.load);
}
if (cmd.loopInterval) {
clearInterval(cmd.loopInterval);
Expand Down

0 comments on commit c8c23fe

Please sign in to comment.