Handle mute result as an IllegalStateException

This commit is contained in:
Him188 2020-03-28 14:16:39 +08:00
parent 8d7e984b1c
commit 8f2843cbfa

View File

@ -288,9 +288,12 @@ internal class GroupImpl(
source = it source = it
source.startWaitingSequenceId(this) source.startWaitingSequenceId(this)
}.sendAndExpect() }.sendAndExpect()
check( if (response is MessageSvc.PbSendMsg.Response.Failed) {
response is MessageSvc.PbSendMsg.Response.SUCCESS when (response.errorCode) {
) { "send message failed: $response" } 120 -> error("bot is being muted.")
else -> error("send message failed: $response")
}
}
} }
return MessageReceipt(source, this, botAsMember) return MessageReceipt(source, this, botAsMember)