Add Bot.botInstancesSequence

This commit is contained in:
Him188 2020-05-28 13:38:49 +08:00
parent 5fd1ba86eb
commit 57b85a3517

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] 实例
*/