Skip to content

Commit

Permalink
Fix boolean option
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPowerGamerBR committed Apr 10, 2024
1 parent 6bad08b commit 289adf1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ open class ApplicationCommandOptions {
.apply(builder)
.also { registeredOptions.add(it) }

fun boolean(name: String, description: String, builder: StringDiscordOptionReference<Boolean>.() -> (Unit) = {}) = StringDiscordOptionReference<Boolean>(name, description, true)
fun boolean(name: String, description: String, builder: BooleanDiscordOptionReference<Boolean>.() -> (Unit) = {}) = BooleanDiscordOptionReference<Boolean>(name, description, true)
.apply(builder)
.also { registeredOptions.add(it) }

fun optionalBoolean(name: String, description: String, builder: StringDiscordOptionReference<Boolean?>.() -> (Unit) = {}) = StringDiscordOptionReference<Boolean?>(name, description, false)
fun optionalBoolean(name: String, description: String, builder: BooleanDiscordOptionReference<Boolean?>.() -> (Unit) = {}) = BooleanDiscordOptionReference<Boolean?>(name, description, false)
.apply(builder)
.also { registeredOptions.add(it) }

Expand Down

0 comments on commit 289adf1

Please sign in to comment.