feat(configuration): Adds missing implermentations

This commit is contained in:
Michel Fedde 2025-06-22 16:27:34 +02:00
parent b82ab7dbc4
commit ec0aa5654c
7 changed files with 150 additions and 32 deletions

View file

@ -13,6 +13,7 @@ import {Container} from "../Container/Container";
import {EventHandler} from "../Events/EventHandler";
import {ModalInteractionEvent} from "../Events/EventClasses/ModalInteractionEvent";
import {ComponentInteractionEvent} from "../Events/EventClasses/ComponentInteractionEvent";
import {log} from "node:util";
enum InteractionRoutingType {
Unrouted,
@ -91,9 +92,9 @@ export class InteractionRouter {
await command.execute?.call(command, interaction);
} catch (e: any) {
this.logger.error(e)
let userMessage = ":x: There was an error while executing this command!";
let logErrorMessage = true;
if (e.constructor.name === UserError.name) {
userMessage = `:x: \`${e.message}\` - Please validate your request!`
if (e.tryInstead) {
@ -102,7 +103,14 @@ export class InteractionRouter {
You can try the following:
${inlineCode(e.tryInstead)}`
}
logErrorMessage = false;
}
if (logErrorMessage) {
this.logger.error(e)
}
if (interaction.replied || interaction.deferred) {
await interaction.followUp({content: userMessage, flags: MessageFlags.Ephemeral});
} else {