mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-23 22:30:47 +08:00
Handle mute result as an IllegalStateException
This commit is contained in:
parent
8d7e984b1c
commit
8f2843cbfa
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user