From 64920a399ed484aff71f79a60abdcef88d966c06 Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 26 Nov 2021 17:31:21 +0000 Subject: [PATCH] Throw a specific exception when reaching maximum AtAll times limit, fix #1201 --- mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt b/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt index c7067ee25..3f522f122 100644 --- a/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt +++ b/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt @@ -173,6 +173,7 @@ internal abstract class SendMessageHandler { val contact = contact when (resp.resultType) { 120 -> if (contact is Group) throw BotIsBeingMutedException(contact) + 121 -> if (AtAll in finalMessage) throw IllegalStateException("Send message to $contact failed, reached maximum AtAll times limit.") } } check(resp is MessageSvcPbSendMsg.Response.SUCCESS) {