This commit is contained in:
parent
85821f5fa3
commit
11dfcc7754
1 changed files with 9 additions and 2 deletions
|
@ -17,7 +17,8 @@ module.exports = {
|
||||||
"<prefix>custom remove - Delete your custom commands.",
|
"<prefix>custom remove - Delete your custom commands.",
|
||||||
"<prefix>custom owner - check owner of custom command",
|
"<prefix>custom owner - check owner of custom command",
|
||||||
"<prefix>custom list - list all custom commands",
|
"<prefix>custom list - list all custom commands",
|
||||||
"<prefix>custom variables - list all variables you can use"
|
"<prefix>custom variables - list all variables you can use",
|
||||||
|
"<prefix>custom count - display the amount of custom commands"
|
||||||
],
|
],
|
||||||
execute({message, args, client, prefix, owners}) {
|
execute({message, args, client, prefix, owners}) {
|
||||||
const customPath = 'data/customCommands.json';
|
const customPath = 'data/customCommands.json';
|
||||||
|
@ -58,7 +59,7 @@ module.exports = {
|
||||||
case "list":
|
case "list":
|
||||||
const embed = new EmbedBuilder();
|
const embed = new EmbedBuilder();
|
||||||
sendText = getAllCustomCommands();
|
sendText = getAllCustomCommands();
|
||||||
if(sendText != ""){
|
if(sendText !== ""){
|
||||||
embed.setColor(15780145)
|
embed.setColor(15780145)
|
||||||
embed.addFields(
|
embed.addFields(
|
||||||
{ name: "Custom commands", value: sendText },
|
{ name: "Custom commands", value: sendText },
|
||||||
|
@ -86,6 +87,12 @@ module.exports = {
|
||||||
case "rename":
|
case "rename":
|
||||||
sendText = renameCustomCommand(customName, args[2], message.author.id);
|
sendText = renameCustomCommand(customName, args[2], message.author.id);
|
||||||
break;
|
break;
|
||||||
|
case "count":
|
||||||
|
const customPath = './data/customCommands.json';
|
||||||
|
let json = fs.readFileSync(customPath, 'utf8');
|
||||||
|
let customCommands = JSON.parse(json)
|
||||||
|
sendText = `There are ${customCommands.length} custom commands in total`;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
sendText = `Argument not recognized.\n"${prefix}help custom" to see all arguments you can use.`
|
sendText = `Argument not recognized.\n"${prefix}help custom" to see all arguments you can use.`
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue