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 Key object representing the error message text.type
: AFailureReason
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: 20 November 2024