Fixed bug
This commit is contained in:
1 parent
62e7e33406
commit
bd26162e4a
1 file changed
+28
-10
+28
-10
@@ -27,7 +27,7 @@ class Client extends Discord.Client {
|
|||||||
.readdirSync("./Addons")
|
.readdirSync("./Addons")
|
||||||
.filter((file) => file.endsWith(".js"));
|
.filter((file) => file.endsWith(".js"));
|
||||||
|
|
||||||
const addons = addonFiles.map((file) => require(`../Addons/${file}`))
|
const addons = addonFiles.map((file) => require(`../Addons/${file}`));
|
||||||
|
|
||||||
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
|
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
|
||||||
|
|
||||||
@@ -39,7 +39,14 @@ class Client extends Discord.Client {
|
|||||||
});
|
});
|
||||||
|
|
||||||
addons.forEach((addon) => {
|
addons.forEach((addon) => {
|
||||||
console.log(`\u001b[33m`, `[ADDON]`, `\u001b[31;1m`, `${addon.name}`, `\u001b[32;1m`, "Loaded");
|
console.log(
|
||||||
|
`\u001b[33m`,
|
||||||
|
`[ADDON]`,
|
||||||
|
`\u001b[31;1m`,
|
||||||
|
`${addon.name}`,
|
||||||
|
`\u001b[32;1m`,
|
||||||
|
"Loaded"
|
||||||
|
);
|
||||||
this.commands.set(addon.name, addon);
|
this.commands.set(addon.name, addon);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -53,7 +60,7 @@ class Client extends Discord.Client {
|
|||||||
permissions: [],
|
permissions: [],
|
||||||
options: cmd.slashCommandOptions,
|
options: cmd.slashCommandOptions,
|
||||||
defaultPermission: true,
|
defaultPermission: true,
|
||||||
}))
|
}));
|
||||||
|
|
||||||
const slashCommands1 = addons.map((addon) => ({
|
const slashCommands1 = addons.map((addon) => ({
|
||||||
name: addon.name.toLowerCase(),
|
name: addon.name.toLowerCase(),
|
||||||
@@ -66,21 +73,32 @@ class Client extends Discord.Client {
|
|||||||
this.removeAllListeners();
|
this.removeAllListeners();
|
||||||
|
|
||||||
this.on("ready", async () => {
|
this.on("ready", async () => {
|
||||||
const cmds = await this.application?.commands.set(slashCommands)
|
const allCommands = slashCommands.concat(slashCommands1);
|
||||||
const addons = await this.application?.commands.set(slashCommands1)
|
await this.application?.commands.set(allCommands);
|
||||||
|
|
||||||
console.log(" ");
|
console.log(" ");
|
||||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Slash Command ▬▬▬▬▬▬▬"),
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Slash Command ▬▬▬▬▬▬▬"),
|
||||||
console.log(" ");
|
console.log(" ");
|
||||||
|
|
||||||
cmds.forEach((cmd) =>
|
slashCommands.forEach((cmd) =>
|
||||||
console.log(`\u001b[31;1m`, `${cmd.name}`, `\u001b[32;1m`, `| Slash Command Registered`)
|
console.log(
|
||||||
|
`\u001b[31;1m`,
|
||||||
|
`${cmd.name}`,
|
||||||
|
`\u001b[32;1m`,
|
||||||
|
`| Slash Command Registered`
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
addons.forEach((addon) =>
|
slashCommands1.forEach((addon) =>
|
||||||
console.log(`\u001b[33m`, `[ADDON]`, `\u001b[31;1m`,`${addon.name}`, `\u001b[32;1m`, `| Slash Command Registered`)
|
console.log(
|
||||||
|
`\u001b[33m`,
|
||||||
|
`[ADDON]`,
|
||||||
|
`\u001b[31;1m`,
|
||||||
|
`${addon.name}`,
|
||||||
|
`\u001b[32;1m`,
|
||||||
|
`| Slash Command Registered`
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(" ");
|
console.log(" ");
|
||||||
|
|||||||
Reference in new issue
Block a user