From b3112dada3be5be2beafad26483431664907d711 Mon Sep 17 00:00:00 2001
From: Karlatemp <karlatemp@vip.qq.com>
Date: Mon, 23 Aug 2021 10:59:23 +0800
Subject: [PATCH] Right exception when bot was muted

---
 mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt b/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt
index 62ad2d36f..322964990 100644
--- a/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt
+++ b/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt
@@ -157,7 +157,7 @@ internal abstract class SendMessageHandler<C : Contact> {
                         }
                         if (resp is MessageSvcPbSendMsg.Response.Failed) {
                             val contact = contact
-                            when (resp.errorCode) {
+                            when (resp.resultType) {
                                 120 -> if (contact is Group) throw BotIsBeingMutedException(contact)
                             }
                         }