Преглед изворни кода

Throw a specific exception when reaching maximum AtAll times limit, fix #1201

Him188 пре 4 година
родитељ
комит
64920a399e
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt

+ 1 - 0
mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt

@@ -173,6 +173,7 @@ internal abstract class SendMessageHandler<C : Contact> {
                             val contact = contact
                             val contact = contact
                             when (resp.resultType) {
                             when (resp.resultType) {
                                 120 -> if (contact is Group) throw BotIsBeingMutedException(contact)
                                 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) {
                         check(resp is MessageSvcPbSendMsg.Response.SUCCESS) {