CompositeCommand usage

This commit is contained in:
jiahua.liu 2020-05-25 14:53:24 +08:00
parent 538cb574f7
commit 9a87497a06

View File

@ -295,3 +295,20 @@ internal inline fun <reified T : Annotation> KAnnotatedElement.hasAnnotation():
internal inline fun <T:Any> KClass<out T>.getInstance():T { internal inline fun <T:Any> KClass<out T>.getInstance():T {
return this.objectInstance ?: this.createInstance() return this.objectInstance ?: this.createInstance()
} }
fun main(){
val mute = object:CompositeCommand(
TestCommandOwner,
"mute"
){
@SubCommand("add")
fun CommandSender.onMute1(@Name("参数名1") target: String):Boolean{
return true
}
}
mute.subCommands
println(mute.usage)
}