mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40: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() }
|
||||
.flatMap { function ->
|
||||
val names = annotationResolver.getSubCommandNames(command, function)
|
||||
if (names.isEmpty()) sequenceOf(createMapEntry(function, null))
|
||||
else names.associateBy { function }.asSequence()
|
||||
if (names.isEmpty()) sequenceOf(createMapEntry(null, function))
|
||||
else names.associateWith { function }.asSequence()
|
||||
}
|
||||
.map { (function, name) ->
|
||||
.map { (name, function) ->
|
||||
|
||||
val functionNameAsValueParameter =
|
||||
name?.split(' ')?.mapIndexed { index, s -> createStringConstantParameter(index, s) }
|
||||
|
Loading…
Reference in New Issue
Block a user