mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-23 05:40:10 +08:00
Simplify code
This commit is contained in:
parent
a5853ba28a
commit
f3f8be5fb6
@ -132,8 +132,7 @@ suspend fun main() {
|
||||
}
|
||||
|
||||
has<Image> {
|
||||
if (this is FriendMessage || (this is GroupMessage && this.permission == MemberPermission.ADMINISTRATOR)) {
|
||||
withContext(IO) {
|
||||
if (this is FriendMessage || (this is GroupMessage && this.permission == MemberPermission.ADMINISTRATOR)) withContext(IO) {
|
||||
val image: Image by message
|
||||
// 等同于 val image = message[Image]
|
||||
|
||||
@ -145,7 +144,7 @@ suspend fun main() {
|
||||
reply(e.message ?: e::class.java.simpleName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
startsWith("上传图片", removePrefix = true) handler@{
|
||||
|
Loading…
Reference in New Issue
Block a user