fix: 当 bot 是管理员时,只有用户是管理员或主人才给禁言、踢人等权限

This commit is contained in:
misaka20002 2025-06-13 00:20:39 +08:00 committed by GitHub
parent 74a7016f46
commit 5bd39473a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -826,7 +826,7 @@ async function collectTools (e) {
let systemAddition = ''
if (e.isGroup) {
let botInfo = await e.bot?.pickMember?.(e.group_id, getUin(e)) || await e.bot?.getGroupMemberInfo?.(e.group_id, getUin(e))
if (botInfo.role !== 'member') {
if (botInfo.role !== 'member' && (e.isMaster || e.sender.role !== 'member')) {
// 管理员才给这些工具
tools.push(...[new EditCardTool(), new JinyanTool(), new KickOutTool(), new HandleMessageMsgTool(), new SetTitleTool()])
// 用于撤回和加精的id