7.2 pre-3

This commit is contained in:
ItzEmerald committed 2021-10-21 19:28:23 +01:00
1 parent 45c3315fd0
commit 85667ddfad
11 files changed
+395 -48

No files matched your search

+42 -6
View File
@@ -26,11 +26,35 @@ class Client extends Discord.Client {
const commands = commandFiles.map(file => require(`../Commands/${file}`));
console.log(`\u001b[34;1m`, '▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬')
commands.forEach(cmd => {
console.log(`Command ${cmd.name} loaded`);
console.log(`\u001b[31;1m`, `${cmd.name}`, `\u001b[32;1m`, 'Loaded');
this.commands.set(cmd.name, cmd);
});
console.log(`\u001b[34;1m`, '▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬')
// Addons
const addonFiles = fs.readdirSync("./Addons")
.filter(file => file.endsWith(".js"));
const addons = addonFiles.map(file => require(`../Addons/${file}`));
console.log(' ')
console.log(`\u001b[34;1m`, '▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬')
addons.forEach(addon => {
console.log(`\u001b[31;1m`, `${addon.name}`, `\u001b[32;1m`, 'Loaded');
this.commands.set(addon.name, addon);
});
console.log(`\u001b[34;1m`, '▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬')
console.log(' ')
// Slash Commands
const slashCommands = commands
.filter(cmd => ["BOTH", "SLASH"].includes(cmd.type))
.map(cmd => ({
@@ -46,20 +70,32 @@ class Client extends Discord.Client {
this.on("ready", async () => {
const cmds = await this.application.commands.set(slashCommands);
cmds.forEach(cmd => console.log(`Slash Command ${cmd.name} registered`));
console.log(' ')
console.log(`\u001b[34;1m`, '▬▬▬▬▬▬▬ Slash Command ▬▬▬▬▬▬▬'),
console.log(' ')
cmds.forEach(cmd =>
console.log(`Slash Command ${cmd.name} registered`),
)
})
console.log(' ')
console.log(`\u001b[34;1m`, '▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬')
fs.readdirSync("./Events")
.filter(file => file.endsWith(".js"))
.forEach(file => {
/**
* @type {Event}
*/
const event = require(`../Events/${file}`);
console.log(`Event ${event.event} loaded`);
console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, 'Loaded');
this.on(event.event, event.run.bind(null, this));
});
console.log(`\u001b[34;1m`, '▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬')
console.log(' ')
this.login(token);
}
}