mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-27 08:50:15 +08:00
Fix docs about selectMessages
, #1160
This commit is contained in:
parent
423665619a
commit
ab56ac4987
@ -459,7 +459,7 @@ val event: BotNudgedEvent = nextEvent<BotNudgedEvent>(5000) { it.bot.id == 12345
|
||||
```kotlin
|
||||
MyCoroutineScope.subscribeAlways<GroupMessageEvent> {
|
||||
if (message.contentEquals("ocr")) {
|
||||
reply("请发送你要进行 OCR 的图片或图片链接")
|
||||
subject.sendMessage("请发送你要进行 OCR 的图片或图片链接")
|
||||
val image: InputStream = selectMessages {
|
||||
has<Image> { URL(it.queryUrl()).openStream() }
|
||||
has<PlainText> { URL(it.content).openStream() }
|
||||
@ -468,7 +468,7 @@ MyCoroutineScope.subscribeAlways<GroupMessageEvent> {
|
||||
} ?: return@subscribeAlways
|
||||
|
||||
val result = ocr(image)
|
||||
quoteReply(result)
|
||||
subject.sendMessage(message.quote() + result)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user