BooleanParser

Object in charge of parsing strings into Booleans using terms defined in the given locale's translations, falling back to the bot's default locale if the input doesn't match.

The relevant translations keys are:

  • utils.string.false for false values

  • utils.string.true for true values

Translations may be split using commas, in which case any of the given values will be suitable.

Functions

Link copied to clipboard
open override fun getKoin(): Koin

Get the associated Koin instance.

Link copied to clipboard
fun parse(input: String, locale: Locale): Boolean?

Parse the given string into a Boolean based on the translations for the given locale. Falls back to the bot's default locale as required.