getManagers

fun getManagers(component: Component): List<BotManager<*>>

通过一个 Component 获取对应组件下的BotManager序列。

例如, 获取某组件下所有bot的所有好友:

OriginBotManager
.getManagers("component.id".ID)
.flatMap { manager -> manager.all() }
.asFlow() // Bot.friends() 是Flow类型
.flatMapConcat { bot -> bot.friends() }

getManagers()?

如果你在寻找不需要参数的 getManagers() 函数,请停下。OriginBotManager 其本身作为一个 Set 的实现即可以直接代表所有的 BotManager

假如你需要遍历所有,那么:

OriginBotManager.forEach { manager ->
// do...
}

fun getManagers(componentId: String): List<BotManager<*>>

根据指定ID查询组件ID与其相等的 BotManager.