소스 검색

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