Functioncustom-idv0.3.2
setCustomIdErrors
Replace the errors that decode throws. Call it before your bot receives any
interaction because the setting is process-wide and each call replaces the last one.
stale gets the route prefix and invalid gets a detail string. You can't localize the message per user
because neither one gets the interaction.
A seedcord bot already calls this at import and replaces both defaults with
Notice subclasses that render a card. To change what the user reads, call it again with your own and
return a Notice subclass from each callback. A plain Error reaches the user as the generic fault card.
setCustomIdErrors(errors: CustomIdErrors): voidclass StaleButton extends Error {}
class BrokenButton extends Error {}
setCustomIdErrors({
stale: (prefix) => new StaleButton(`${prefix} came from an older deploy`),
invalid: (detail) => new BrokenButton(detail)
});errors
errors: CustomIdErrors