1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-03-26 07:20:09 +08:00

Improve exception message for PermissionDeniedException

This commit is contained in:
Him188 2020-09-12 00:11:08 +08:00
parent f28df741c8
commit ec0ec396ef

View File

@ -197,8 +197,8 @@ internal class MemberImpl constructor(
private fun checkBotPermissionHigherThanThis(operationName: String) {
check(group.botPermission > this.permission) {
throw PermissionDeniedException(
"`$operationName` operation requires bot to have a higher permission than the target member, " +
"but bot's is ${group.botPermission}, target's is ${this.permission}"
"`$operationName` operation requires a higher permission, while" +
"${group.botPermission} < ${this.permission}"
)
}
}