Commit 8f2843cb authored by Him188's avatar Him188

Handle mute result as an IllegalStateException

parent 8d7e984b
......@@ -288,9 +288,12 @@ internal class GroupImpl(
source = it
source.startWaitingSequenceId(this)
}.sendAndExpect()
check(
response is MessageSvc.PbSendMsg.Response.SUCCESS
) { "send message failed: $response" }
if (response is MessageSvc.PbSendMsg.Response.Failed) {
when (response.errorCode) {
120 -> error("bot is being muted.")
else -> error("send message failed: $response")
}
}
}
return MessageReceipt(source, this, botAsMember)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment