调整管理员信息

This commit is contained in:
liuwei
2026-01-19 14:11:29 +08:00
parent 316b35cb93
commit 9ca6123891
3 changed files with 10 additions and 7 deletions

View File

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