Throw BotIsBeingMutedException on errorCode 120 when sending message

This commit is contained in:
Him188 2021-03-04 14:49:53 +08:00
parent a06189d835
commit ad04cd35a4

View File

@ -149,6 +149,12 @@ internal abstract class SendMessageHandler<C : Contact> {
}
}
}
if (resp is MessageSvcPbSendMsg.Response.Failed) {
val contact = contact
when (resp.errorCode) {
120 -> if (contact is Group) throw BotIsBeingMutedException(contact)
}
}
check(resp is MessageSvcPbSendMsg.Response.SUCCESS) {
"Send group message failed: $resp"
}