diff --git a/src/events/interactionCreate/components/isCommand.ts b/src/events/interactionCreate/components/isCommand.ts index 30edc4c..91c61dd 100644 --- a/src/events/interactionCreate/components/isCommand.ts +++ b/src/events/interactionCreate/components/isCommand.ts @@ -6,6 +6,7 @@ import logger from "@logger"; import deferReply from "@root/helpers/deferReply"; import getEmbedConfig from "@helpers/getEmbedConfig"; import getCommandMetadata from "@helpers/getCommandMetadata"; +import capitalizeFirstLetter from "@helpers/capitalizeFirstLetter"; export default async (interaction: CommandInteraction) => { if (!interaction.isCommand()) return; @@ -89,10 +90,12 @@ export default async (interaction: CommandInteraction) => { return interaction.editReply({ embeds: [ new MessageEmbed() - .setTitle("Error") - .setDescription( - `There was an error executing the command: **${currentCommand?.data?.name}**.` + .setTitle( + `[:x:] ${capitalizeFirstLetter( + interaction.options.getSubcommand() + )}` ) + .setDescription(`${"``"}${error}${"``"}`) .setColor(errorColor) .setTimestamp(new Date()) .setFooter({ text: footerText, iconURL: footerIcon }), diff --git a/src/helpers/capitalizeFirstLetter.ts b/src/helpers/capitalizeFirstLetter.ts new file mode 100644 index 0000000..1190b36 --- /dev/null +++ b/src/helpers/capitalizeFirstLetter.ts @@ -0,0 +1,3 @@ +export default (text: string): string => { + return text.charAt(0).toUpperCase() + text.slice(1); +};