Skip to content

Commit

Permalink
Fix unable to unset values, Fix #14
Browse files Browse the repository at this point in the history
Signed-off-by: shedaniel <[email protected]>
  • Loading branch information
shedaniel committed Aug 19, 2021
1 parent cf92047 commit 6b54ed1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import me.shedaniel.linkie.discord.SimpleCommand
import me.shedaniel.linkie.discord.config.ConfigManager
import me.shedaniel.linkie.discord.scommands.SlashCommandBuilderInterface
import me.shedaniel.linkie.discord.scommands.opt
import me.shedaniel.linkie.discord.scommands.optNullable
import me.shedaniel.linkie.discord.scommands.string
import me.shedaniel.linkie.discord.scommands.stringUnlimited
import me.shedaniel.linkie.discord.utils.CommandContext
Expand All @@ -36,11 +37,11 @@ object SetValueCommand : SimpleCommand<SetValueCommand.SetValueData> {

override suspend fun SlashCommandBuilderInterface.buildCommand(slash: Boolean) {
val propertyName = string("property", "The property name")
val value = stringUnlimited("value", "The property value")
val value = stringUnlimited("value", "The property value", required = false)
executeCommandWith {
SetValueData(
property = opt(propertyName),
value = opt(value),
value = optNullable(value) ?: "",
)
}
}
Expand Down

0 comments on commit 6b54ed1

Please sign in to comment.