mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-21 07:56:56 +08:00
Make Announcements.asStream
not suspend
This commit is contained in:
parent
9f1343c02e
commit
47192f3ee3
@ -37,7 +37,7 @@ public interface Announcements {
|
||||
/**
|
||||
* 创建一个能获取该群内所有群公告列表的 [Stream]. 在 [Stream] 被使用时才会分页下载 [OnlineAnnouncement].
|
||||
*/
|
||||
public suspend fun asStream(): Stream<OnlineAnnouncement>
|
||||
public fun asStream(): Stream<OnlineAnnouncement>
|
||||
|
||||
/**
|
||||
* 获取所有群公告列表, 将全部 [OnlineAnnouncement] 都下载后再返回.
|
||||
|
@ -73,7 +73,7 @@ internal class AnnouncementsImpl(
|
||||
}.map { it.toAnnouncement(group) }
|
||||
}
|
||||
|
||||
override suspend fun asStream(): Stream<OnlineAnnouncement> {
|
||||
override fun asStream(): Stream<OnlineAnnouncement> {
|
||||
return stream {
|
||||
var i = 1
|
||||
while (true) {
|
||||
|
Loading…
Reference in New Issue
Block a user