Kord-Extensions/kord-extensions

Check customization

Closed this issue · 2 comments

Summary

Checks, to be more exact the error messages, should be better/more customizable.

Current Behaviour

At the moment there is no customization beside of the message, even though that also has a lack on customization.
The message is always a simple string, prefixed by "Error:".

Preferred Behaviour

Checks should be able to send fully customizable messages, i.e. via MessageBuilder and should not automatically be prefixed with an error, as some check's are not errornous, it's just a state validation.

I've pushed the following changes:

  • In CheckContext, errorResponseKey and defaultBundle may now be modified by your check functions to point at new response translation keys and translation bundles
  • In ExtensibleBotBuilder, the errorResponse DSL has been made available for you to change how the message returned by a check (or any other type of error) is formatted, globally

Is this enough, or does it need to be more granular?

After some discussion in discord, the commit e03bffb resolved this. Thank you!