perf: 完善身份组功能
This commit is contained in:
+6
-1
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user