abstract away prefix + ev cmd
All checks were successful
Deploy bot / build-and-deploy (push) Successful in 14s

This commit is contained in:
2025-08-08 17:03:24 +02:00
parent a57aa17deb
commit 1009165751
14 changed files with 226 additions and 51 deletions

View File

@ -2,8 +2,8 @@ const { EmbedBuilder } = require("discord.js");
exports.name = "help";
exports.description =
":scroll: Shows this message and provides insight into other commands.";
exports.usage = "<<help [optional other command]";
exports.example = "<<help res";
exports.usage = "CLIENT_PREFIX:help [optional other command]";
exports.example = "CLIENT_PREFIX:help res";
exports.hidden = false;
exports.run = (client, message, args) => {
let embed = new EmbedBuilder();
@ -12,7 +12,10 @@ exports.run = (client, message, args) => {
const cmd = client.commands.get(args[0]);
if (!cmd)
return message.channel.send(
"Command not found, try `<<help` first."
"Command not found, try `CLIENT_PREFIX:help` first.".replaceAll(
"CLIENT_PREFIX:",
client.prefix
)
);
if (cmd.hidden && message.author.id != client.ownerID) return;
embed.setTitle(`Help for \`${cmd.name}\` command`);
@ -20,11 +23,11 @@ exports.run = (client, message, args) => {
embed.addFields(
{
name: "Usage",
value: cmd.usage,
value: cmd.usage.replaceAll("CLIENT_PREFIX:", client.prefix),
},
{
name: "Example",
value: cmd.example,
value: cmd.example.replaceAll("CLIENT_PREFIX:", client.prefix),
}
);
} else {
@ -34,7 +37,10 @@ exports.run = (client, message, args) => {
if (cmd.hidden && message.author.id != client.ownerID) return;
embed.addFields({
name: cmd.name,
value: cmd.description,
value: cmd.description.replaceAll(
"CLIENT_PREFIX:",
client.prefix
),
});
});
}