If an interaction handler throws and the interaction wasn't responded to, we could consider calling .showMessage with a formatted error.
Two forms of errors should be accepted, one being a custom error class like InteractionError, which contains CreateMessageData and can be passed directly as the response, with normal errors having a preset formatter.
This behavior should be configurable within the config, so we might be depending on #9. Config should follow this schema:
interactionErrors.enable if this behavior is enabled or not
interactionErrors.formatter a function to format an Error to a CreateMessageData
interactionErrors.ephemeral (true default), specifies what the ephemeral flag is default to, if the formatter doesn't specify this flag.
interactionErrors: false disable entirely
interactionErrors: true enable with default settings
when InteractionError is written, the default formatter should be a static method on it, meaning the default config entry is just formatter: InteractionError.defaultFormatter
If an interaction handler throws and the interaction wasn't responded to, we could consider calling
.showMessage
with a formatted error.Two forms of errors should be accepted, one being a custom error class like
InteractionError
, which containsCreateMessageData
and can be passed directly as the response, with normal errors having a preset formatter.This behavior should be configurable within the config, so we might be depending on #9. Config should follow this schema:
interactionErrors.enable
if this behavior is enabled or notinteractionErrors.formatter
a function to format anError
to aCreateMessageData
interactionErrors.ephemeral
(true default), specifies what theephemeral
flag is default to, if the formatter doesn't specify this flag.interactionErrors: false
disable entirelyinteractionErrors: true
enable with default settings