mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-31 19:40:24 +08:00
[core] Improve error message of NormalMember.modifyAdmin(); #2370
This commit is contained in:
parent
943be41108
commit
b5fcbe99fb
@ -213,7 +213,17 @@ internal class NormalMemberImpl constructor(
|
||||
) as TroopManagement.ModifyAdmin.Response
|
||||
|
||||
check(resp.success) {
|
||||
"Failed to modify admin, cause: ${resp.msg}"
|
||||
buildString {
|
||||
append("Failed to ")
|
||||
append(if (operation) "grant" else "revoke")
|
||||
append(" administrator privileges ")
|
||||
append(if (operation) "to" else "from")
|
||||
append(" member ")
|
||||
append(id).append(" in group ").append(group.id)
|
||||
|
||||
append(": code=").append(resp.code)
|
||||
append(", msg=").append(resp.msg)
|
||||
}
|
||||
}
|
||||
|
||||
this@NormalMemberImpl.permission = new
|
||||
|
Loading…
Reference in New Issue
Block a user