Kord Extensions Help

Error Responses

The errorResponse function allows you to register a custom failure response callback. This callback takes the form of a receiver function against a MessageCreateBuilder, and it takes several parameters:

  • message: A String representing the error message text.

  • type: A FailureReason representing the type of error, and containing the relevant exception.

By default, Kord Extensions will relay the message text to Discord without editing it, preventing anyone from being pinged by any mentions in the message text. If you'd like, you can customize this by treating it as if you were sending any other message.

ExtensibleBot(TOKEN) { // ... errorResponse { allowedMentions { } embed { title = "Oopsie Woopsie!" color = DISCORD_MAGENTA description = message } } }
Last modified: 03 September 2024