mirai-core / net.mamoe.mirai.contact / checkBotPermissionOperator

checkBotPermissionOperator

inline fun Group.checkBotPermissionOperator(crossinline lazyMessage: () -> String = { "Permission denied: required ${MemberPermission.ADMINISTRATOR} or ${MemberPermission.OWNER}, got actual $botPermission for $bot in group $id" }): Unit

要求 Bot 在这个群里的权限为 管理员或群主, 否则抛出异常 PermissionDeniedException

Exceptions

PermissionDeniedException -