26 lines
738 B
JavaScript
26 lines
738 B
JavaScript
|
const schema = require("../../models/custom-commands");
|
||
|
const { MessageEmbed } = require("discord.js");
|
||
|
|
||
|
module.exports = {
|
||
|
name: "cc-list",
|
||
|
UserPerm: "ADMINISTRATOR",
|
||
|
description: "Check the custom commands in a server",
|
||
|
category: "Config",
|
||
|
/**
|
||
|
* @param {Client} client
|
||
|
* @param {Message} message
|
||
|
* @param {String[]} args
|
||
|
*/
|
||
|
run: async (client, message, args) => {
|
||
|
const data = await schema.find({ Guild: message.guild.id });
|
||
|
if (!!data === false) return client.err(messgae, "Config", "cmd-list", 10);
|
||
|
message.channel.send(
|
||
|
new MessageEmbed()
|
||
|
.setColor(client.color)
|
||
|
.setDescription(
|
||
|
data.map((cmd, i) => `${i + 1}: ${cmd.Command}`).join("\n")
|
||
|
)
|
||
|
);
|
||
|
},
|
||
|
};
|