Skip to content

Commit

Permalink
[6.0.10][publish] update command
Browse files Browse the repository at this point in the history
  • Loading branch information
Bkm016 committed Apr 23, 2023
1 parent 0989c22 commit afb46ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fun CommandComponentDynamic.suggestUncheck(suggest: () -> List<String>?): Comman
* 创建参数补全(仅布尔值)
*/
fun CommandComponentDynamic.suggestBoolean(): CommandComponentDynamic {
return suggest { listOf("true", "false", "t", "f") }
return suggest { listOf("true", "false", "t", "f", "1", "0") }
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fun <T> CommandContext<T>.floatOrNull(id: String): Float? {
*/
fun <T> CommandContext<T>.bool(id: String): Boolean {
val value = get(id)
return value.equals("true", true) || value.equals("1", true)
return value.equals("true", true) || value.equals("t", true) || value.equals("1", true)
}

/**
Expand All @@ -86,5 +86,5 @@ fun <T> CommandContext<T>.bool(id: String): Boolean {
*/
fun <T> CommandContext<T>.boolOrNull(id: String): Boolean? {
val value = getOrNull(id) ?: return null
return value.equals("true", true) || value.equals("1", true)
return value.equals("true", true) || value.equals("t", true) || value.equals("1", true)
}

0 comments on commit afb46ac

Please sign in to comment.