调整管理员信息

This commit is contained in:
liuwei
2026-01-19 14:15:46 +08:00
parent 9ca6123891
commit d3d48b0821
3 changed files with 9 additions and 14 deletions

View File

@@ -203,7 +203,7 @@ class RobotMenuPlugin(MessagePluginInterface):
# 格式:菜单 启用 功能名 或 菜单 关闭 功能名
if len(parts) >= 3 and parts[1] in ["启用", "关闭"]:
# 检查管理员权限
if not self._is_admin(sender):
if not GroupBotManager.is_admin(sender):
await bot.send_at_message(target, "❌权限不足,只有管理员可以管理功能", [sender])
return True, "权限不足"
@@ -252,9 +252,3 @@ class RobotMenuPlugin(MessagePluginInterface):
import traceback
self.LOG.error(traceback.format_exc())
return False, f"处理出错: {e}"
def _is_admin(self, user_id: str) -> bool:
"""检查用户是否为管理员"""
# admin_list 现在是 GroupBotManager 的类属性,可以直接访问
admin_list = GroupBotManager.get_admin_list()
return user_id in admin_list