Commit 57b85a35 authored by Him188's avatar Him188

Add Bot.botInstancesSequence

parent 5fd1ba86
...@@ -84,6 +84,15 @@ abstract class Bot internal constructor( ...@@ -84,6 +84,15 @@ abstract class Bot internal constructor(
val botInstances: List<Bot> val botInstances: List<Bot>
get() = _instances.asSequence().mapNotNull { it.get() }.toList() 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] 实例 * 遍历每一个 [Bot] 实例
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment