mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-11 02:50:15 +08:00
Fix command reflection
This commit is contained in:
parent
80e869e8c9
commit
71c744c429
@ -230,10 +230,10 @@ internal class CommandReflector(
|
|||||||
.onEach { it.checkNames() }
|
.onEach { it.checkNames() }
|
||||||
.flatMap { function ->
|
.flatMap { function ->
|
||||||
val names = annotationResolver.getSubCommandNames(command, function)
|
val names = annotationResolver.getSubCommandNames(command, function)
|
||||||
if (names.isEmpty()) sequenceOf(createMapEntry(function, null))
|
if (names.isEmpty()) sequenceOf(createMapEntry(null, function))
|
||||||
else names.associateBy { function }.asSequence()
|
else names.associateWith { function }.asSequence()
|
||||||
}
|
}
|
||||||
.map { (function, name) ->
|
.map { (name, function) ->
|
||||||
|
|
||||||
val functionNameAsValueParameter =
|
val functionNameAsValueParameter =
|
||||||
name?.split(' ')?.mapIndexed { index, s -> createStringConstantParameter(index, s) }
|
name?.split(' ')?.mapIndexed { index, s -> createStringConstantParameter(index, s) }
|
||||||
|
Loading…
Reference in New Issue
Block a user