mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Cleanup code
This commit is contained in:
parent
77e38dd964
commit
cdefb2dbed
@ -71,7 +71,7 @@ internal object SimpleCommandSubCommandAnnotationResolver :
|
|||||||
override fun getAnnotatedName(ownerCommand: Command, parameter: KParameter): String? =
|
override fun getAnnotatedName(ownerCommand: Command, parameter: KParameter): String? =
|
||||||
parameter.findAnnotation<SimpleCommand.Name>()?.value
|
parameter.findAnnotation<SimpleCommand.Name>()?.value
|
||||||
|
|
||||||
override fun getDescription(ownerCommand: Command, function: KFunction<*>): String? =
|
override fun getDescription(ownerCommand: Command, function: KFunction<*>): String =
|
||||||
ownerCommand.description
|
ownerCommand.description
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ internal class CommandReflector(
|
|||||||
}.toList()
|
}.toList()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun KParameter.toCommandReceiverParameter(): CommandReceiverParameter<out CommandSender>? {
|
private fun KParameter.toCommandReceiverParameter(): CommandReceiverParameter<out CommandSender> {
|
||||||
check(!this.isVararg) { "Receiver cannot be vararg." }
|
check(!this.isVararg) { "Receiver cannot be vararg." }
|
||||||
check(this.type.classifierAsKClass().isSubclassOf(CommandSender::class)) { "Receiver must be subclass of CommandSender" }
|
check(this.type.classifierAsKClass().isSubclassOf(CommandSender::class)) { "Receiver must be subclass of CommandSender" }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user