Simplify code

This commit is contained in:
Him188 2019-12-04 20:43:29 +08:00
parent a5853ba28a
commit f3f8be5fb6

View File

@ -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@{