g
This commit is contained in:
38
commands/help.js
Normal file
38
commands/help.js
Normal file
@ -0,0 +1,38 @@
|
||||
const { EmbedBuilder } = require("discord.js");
|
||||
exports.name = "help";
|
||||
exports.description =
|
||||
":scroll: Shows this message. (this bot is a crude imitation of tbolt's better bot :P)";
|
||||
exports.usage = "<<help [optional other command]";
|
||||
exports.example = "<<help res";
|
||||
exports.run = (client, message, args) => {
|
||||
let embed = new EmbedBuilder();
|
||||
embed.setTitle("Commands Helper");
|
||||
if (args[0]) {
|
||||
const cmd = client.commands.get(args[0]);
|
||||
if (!cmd)
|
||||
return message.channel.send(
|
||||
"Command not found, try `<<help` first."
|
||||
);
|
||||
embed.setTitle(`Help for \`${cmd.name}\` command`);
|
||||
embed.setDescription(cmd.description);
|
||||
embed.addFields(
|
||||
{
|
||||
name: "Usage",
|
||||
value: cmd.usage,
|
||||
},
|
||||
{
|
||||
name: "Example",
|
||||
value: cmd.example,
|
||||
}
|
||||
);
|
||||
} else {
|
||||
client.commands.forEach((cmd) => {
|
||||
embed.addFields({
|
||||
name: cmd.name,
|
||||
value: cmd.description,
|
||||
});
|
||||
});
|
||||
}
|
||||
embed.setColor(0x00ff00);
|
||||
message.channel.send({ embeds: [embed] });
|
||||
};
|
Reference in New Issue
Block a user