You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Natsuki/commands/misc/commands.js

25 lines
1.2 KiB

4 years ago
const Discord = require('discord.js');
module.exports = {
name: "commands",
aliases: ['cmds', 'commandlist', 'cmdlist'],
meta: {
category: 'Misc',
description: "Shows a list of my commands",
syntax: '`commands`',
extra: null
},
help: "Shows a list of all my commands",
async execute(message, msg, args, cmd, prefix, mention, client) {
let categories = [];
Array.from(client.commands.values()).forEach(c => {console.log(c); if (!categories.includes(c.meta ? c.meta.category : 'Uncategorized')) {categories.push(c.meta ? c.meta.category : 'Uncategorized');}});
let ce = new Discord.MessageEmbed()
.setTitle("Commands")
.setDescription(`You can use \`${prefix}help\` on any command to get more help on it.`)
4 years ago
.setColor('c375f0')
4 years ago
.setFooter("Natsuki", client.user.avatarURL())
.setTimestamp();
categories.forEach(category => ce.addField(category, Array.from(client.commands.values()).filter(command => command.meta ? command.meta.category === category : category === "Uncategorized").map(cmd => `\`${cmd.name}\``).join(', ')));
3 years ago
return message.channel.send({embeds: [ce]});
4 years ago
}
};