From 900299982482435ff4d13c708c0720ea1042d0c0 Mon Sep 17 00:00:00 2001 From: Stanlty998 <86192420+Stanlty998@users.noreply.github.com> Date: Tue, 16 Jun 2026 14:26:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=BA=E5=99=A8=E4=BA=BA?= =?UTF-8?q?=E4=BD=9C=E4=B8=BA=E7=BE=A4=E4=B8=BB=E6=97=B6=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E7=A6=81=E8=A8=80=E7=AE=A1=E7=90=86=E5=91=98=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tool/tool_ban.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tool/tool_ban.ts b/src/tool/tool_ban.ts index 10c846f..d3e5265 100644 --- a/src/tool/tool_ban.ts +++ b/src/tool/tool_ban.ts @@ -42,7 +42,8 @@ export function registerBan() { const memberInfo2 = await getGroupMemberInfo(epId, gid.replace(/^.+:/, ''), ui.id.replace(/^.+:/, '')); if (!memberInfo2) return { content: `获取用户 ${ui.id} 信息失败`, images: [] }; - if (memberInfo2.role === 'owner' || memberInfo2.role === 'admin') return { content: `你无法禁言${memberInfo2.role === 'owner' ? '群主' : '管理员'}`, images: [] }; + if (memberInfo2.role === 'owner') return { content: `你无法禁言群主`, images: [] }; + if (memberInfo2.role === 'admin' && memberInfo.role !== 'owner') return { content: `你无法禁言管理员,因为你不是群主`, images: [] }; await setGroupBan(epId, gid.replace(/^.+:/, ''), ui.id.replace(/^.+:/, ''), duration); return { content: `已禁言<${name}> ${duration}秒`, images: [] }; @@ -108,4 +109,4 @@ export function registerBan() { return { content: s, images: [] }; } -} \ No newline at end of file +}