diff --git a/cores/qqbot/core.py b/cores/qqbot/core.py index b2798a758..5343bdc04 100644 --- a/cores/qqbot/core.py +++ b/cores/qqbot/core.py @@ -465,8 +465,13 @@ def oper_msg(message, group=False, msg_ref = None, platform = None): else: qq_msg = message.message[0].text session_id = message.user_id - # todo: 暂时将所有人设为管理员 role = "admin" + if "sender" in message: + if message.sender.role == "owner": + role = "admin" + else: + role = message.sender.role + print("[GOCQ-BOT] 消息身份:"+ role) if qq_msg == "": send_message(platform, message, f"Hi~", msg_ref=msg_ref, gocq_loop=gocq_loop, qqchannel_bot=qqchannel_bot, gocq_bot=gocq_bot) diff --git a/model/command/command.py b/model/command/command.py index 151c97b65..782102d29 100644 --- a/model/command/command.py +++ b/model/command/command.py @@ -53,6 +53,8 @@ class Command: 插件指令 ''' def plugin_oper(self, message: str, role: str): + if role != "admin": + return False, f"你的身份组{role}没有权限操作插件", "plugin" l = message.split(" ") if len(l) < 3: return True, "【安装插件】示例:\n安装插件: \nplugin i 插件Github地址\n卸载插件: \nplugin i 插件名", "plugin"