still lagging
This commit is contained in:
parent
3e74186158
commit
6c3223b7f0
2 changed files with 37 additions and 37 deletions
|
@ -1,39 +1,39 @@
|
||||||
const { readdirSync } = require("fs");
|
const { readdirSync } = require("fs");
|
||||||
const utils = require("../../util/functions/function");
|
const utils = require("../util/functions/function");
|
||||||
function cmds() {
|
function cmds() {
|
||||||
const categories = [];
|
const categories = [];
|
||||||
readdirSync("./commands").forEach(dir => {
|
readdirSync("./commands").forEach(dir => {
|
||||||
const dirs = readdirSync(`./commands/${dir}`).filter(file =>
|
const dirs = readdirSync(`./commands/${dir}`).filter(file =>
|
||||||
file.endsWith(".js"),
|
file.endsWith(".js")
|
||||||
);
|
);
|
||||||
const commands = [];
|
const commands = [];
|
||||||
dirs.map(cmd => {
|
dirs.map(cmd => {
|
||||||
const file = require(`../../commands/${dir}/${cmd}`);
|
const file = require(`../../commands/${dir}/${cmd}`);
|
||||||
commands.push({
|
commands.push({
|
||||||
name: file.name ? file.name : "No command name",
|
name: file.name ? file.name : "No command name",
|
||||||
description: file.description
|
description: file.description
|
||||||
? file.description
|
? file.description
|
||||||
: "No command description",
|
: "No command description",
|
||||||
aliases: file.aliases ? file.aliases : "No command aliases",
|
aliases: file.aliases ? file.aliases : "No command aliases",
|
||||||
usage: file.usage ? `C.${file.name} ${file.usage}` : `C.${file.name}`,
|
usage: file.usage ? `C.${file.name} ${file.usage}` : `C.${file.name}`,
|
||||||
timeout: file.timeout
|
timeout: file.timeout
|
||||||
? utils.ms(file.timeout, { long: true })
|
? utils.ms(file.timeout, { long: true })
|
||||||
: "No command cooldown",
|
: "No command cooldown",
|
||||||
BotPermission: file.BotPerms
|
BotPermission: file.BotPerms
|
||||||
? file.BotPerms
|
? file.BotPerms
|
||||||
: "No required bot permission",
|
: "No required bot permission",
|
||||||
UserPermission: file.UserPerms
|
UserPermission: file.UserPerms
|
||||||
? file.UserPerms
|
? file.UserPerms
|
||||||
: "No required user permission",
|
: "No required user permission",
|
||||||
status: file.status ? file.status : true,
|
status: file.status ? file.status : true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const data = {
|
const data = {
|
||||||
name: dir,
|
name: dir,
|
||||||
commands,
|
commands,
|
||||||
};
|
};
|
||||||
categories.push(data);
|
categories.push(data);
|
||||||
});
|
});
|
||||||
return categories;
|
return categories;
|
||||||
}
|
}
|
||||||
module.exports = { cmds };
|
module.exports = { cmds };
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const { MessageEmbed } = require("discord.js");
|
const { MessageEmbed } = require("discord.js");
|
||||||
const client = require("../..");
|
const client = require("..");
|
||||||
/**
|
/**
|
||||||
* @param {String} message
|
* @param {String} message
|
||||||
* @param {String} dir
|
* @param {String} dir
|
||||||
|
@ -205,7 +205,7 @@ module.exports = async (message, dir, file, err) => {
|
||||||
)
|
)
|
||||||
.setColor("RED")
|
.setColor("RED")
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`${require("../../config").ca}\nUse \`${pre}help ${
|
`${require("../config").ca}\nUse \`${pre}help ${
|
||||||
pull.name
|
pull.name
|
||||||
}\` to get help\n\n `
|
}\` to get help\n\n `
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue