const fs = require('fs')
module.exports = (client) => {
const interactionLogs = new Discord.WebhookClient({
id: client.webhooks.interactionLogs.id,
token: client.webhooks.interactionLogs.token,
});
const commands = [];
if (client.shard.ids[0] === 0) console.log(chalk.blue(chalk.bold(`System`)), (chalk.white(`>>`)), (chalk.green(`Loading prefix commands.`)), (chalk.white(`...`)))
if (client.shard.ids[0] === 0) console.log(`\u001b[0m`);
fs.readdirSync('./src/Commands').forEach(dirs => {
client.prefixCommands = async (commandFolders, path) => {
client.prefixArray = [];
for (folder of commandFolders) {
const commandFiles = fs.readdirSync('./src/Commands').filter(file => file.endsWith('.js'));
if (client.shard.ids[0] === 0) console.log(chalk.blue(chalk.bold(`System`)), (chalk.white(`>>`)), chalk.red(`${commandFiles.length}`), (chalk.green(`commands of`)), chalk.red(`${dirs}`), (chalk.green(`loaded`)));
for (const file in commandFiles) {
const command = require(`../Commanands/${folder}/${file}`);
client.pcommands.set(command.name, command);
client.prefixArray.push(command);
if (command.aliases && Array.isArray(command.aliases)) {
command.aliases.forEach(alias) => {
client.aliases.set (alias, command.name)
}
}
}
}
(async () => {
try {
console.log("Started refreshing prefix commands.");
console.log("Successfully reloaded prefix commands.")
} catch (err) {
console.log(err)
}
})
}
}
const fs = require('fs')
module.exports = (client) => {
const interactionLogs = new Discord.WebhookClient({
id: client.webhooks.interactionLogs.id,
token: client.webhooks.interactionLogs.token,
});
const commands = [];
if (client.shard.ids[0] === 0) console.log(chalk.blue(chalk.bold(`System`)), (chalk.white(`>>`)), (chalk.green(`Loading prefix commands.`)), (chalk.white(`...`)))
if (client.shard.ids[0] === 0) console.log(`\u001b[0m`);
fs.readdirSync('./src/Commands').forEach(dirs => {
client.prefixCommands = async (commandFolders, path) => {
client.prefixArray = [];
for (folder of commandFolders) {
const commandFiles = fs.readdirSync('./src/Commands').filter(file => file.endsWith('.js'));
if (client.shard.ids[0] === 0) console.log(chalk.blue(chalk.bold(`System`)), (chalk.white(`>>`)), chalk.red(`${commandFiles.length}`), (chalk.green(`commands of`)), chalk.red(`${dirs}`), (chalk.green(`loaded`)));
for (const file in commandFiles) {
const command = require(`../Commanands/${folder}/${file}`);
client.pcommands.set(command.name, command);
client.prefixArray.push(command);
if (command.aliases && Array.isArray(command.aliases)) {
command.aliases.forEach(alias) => {
client.aliases.set (alias, command.name)
}
}
}
}
(async () => {
try {
console.log("Started refreshing prefix commands.");
console.log("Successfully reloaded prefix commands.")
} catch (err) {
console.log(err)
}
})
}
}