mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-13 14:50:43 +08:00
Fix case in command names
This commit is contained in:
parent
7012fe0f62
commit
2746a30c70
@ -241,7 +241,7 @@ internal class CommandReflector(
|
|||||||
.map { (name, function) ->
|
.map { (name, function) ->
|
||||||
|
|
||||||
val functionNameAsValueParameter =
|
val functionNameAsValueParameter =
|
||||||
name?.split(' ')?.mapIndexed { index, s -> createStringConstantParameter(index, s) }
|
name?.split(' ')?.mapIndexed { index, s -> createStringConstantParameterForName(index, s) }
|
||||||
.orEmpty()
|
.orEmpty()
|
||||||
|
|
||||||
val functionValueParameters =
|
val functionValueParameters =
|
||||||
@ -297,8 +297,8 @@ internal class CommandReflector(
|
|||||||
return CommandReceiverParameter(this.type.isMarkedNullable, this.type)
|
return CommandReceiverParameter(this.type.isMarkedNullable, this.type)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createStringConstantParameter(index: Int, expectingValue: String): AbstractCommandValueParameter.StringConstant {
|
private fun createStringConstantParameterForName(index: Int, expectingValue: String): AbstractCommandValueParameter.StringConstant {
|
||||||
return AbstractCommandValueParameter.StringConstant("#$index", expectingValue)
|
return AbstractCommandValueParameter.StringConstant("#$index", expectingValue, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun KParameter.toUserDefinedCommandParameter(): AbstractCommandValueParameter.UserDefinedType<*> {
|
private fun KParameter.toUserDefinedCommandParameter(): AbstractCommandValueParameter.UserDefinedType<*> {
|
||||||
|
Loading…
Reference in New Issue
Block a user