1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-02 05:00:35 +08:00

Add Bot.botInstancesSequence

This commit is contained in:
Him188 2020-05-28 13:38:49 +08:00
parent ab6269b3ae
commit a5d613cf67

View File

@ -84,6 +84,15 @@ abstract class Bot internal constructor(
val botInstances: List<Bot>
get() = _instances.asSequence().mapNotNull { it.get() }.toList()
/**
* 复制一份此时的 [Bot] 实例列表.
*/
@MiraiExperimentalAPI
@SinceMirai("1.1.0")
@JvmStatic
val botInstancesSequence: Sequence<Bot>
get() = _instances.asSequence().mapNotNull { it.get() }
/**
* 遍历每一个 [Bot] 实例
*/