From a3837b03cb8726a87f90212509b6a16e3bca060a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=91=E8=B4=A8?= Date: Wed, 26 Oct 2022 09:27:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=8E=A8=E8=BF=9B=E8=87=B30.?= =?UTF-8?q?9.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + group_message事件的sender任何时候都有role --- OlivOSOnebotV11/app.json | 4 ++-- OlivOSOnebotV11/eventRouter.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/OlivOSOnebotV11/app.json b/OlivOSOnebotV11/app.json index 5e894da..ea907b6 100644 --- a/OlivOSOnebotV11/app.json +++ b/OlivOSOnebotV11/app.json @@ -4,8 +4,8 @@ "namespace" : "OlivOSOnebotV11", "info" : "基于OlivOS的OneBot协议端,可以基于OlivOS实现多后端对多账号、多平台的支持。", "message_mode" : "olivos_para", - "version" : "0.9.1", - "svn" : 15, + "version" : "0.9.2", + "svn" : 16, "compatible_svn" : 100, "priority" : 50000, "support" : [ diff --git a/OlivOSOnebotV11/eventRouter.py b/OlivOSOnebotV11/eventRouter.py index d0db4d4..a76415d 100644 --- a/OlivOSOnebotV11/eventRouter.py +++ b/OlivOSOnebotV11/eventRouter.py @@ -200,8 +200,11 @@ def group_message(eventObj): eventObj.rvData['anonymous'] = None eventObj.rvData['font'] = eventObj.plugin_event.data.font eventObj.rvData['sender'] = {} - eventObj.rvData['sender']['user_id'] = eventObj.plugin_event.data.sender['id'] + eventObj.rvData['sender']['user_id'] = int(eventObj.plugin_event.data.sender['id']) eventObj.rvData['sender']['nickname'] = eventObj.plugin_event.data.sender['name'] + eventObj.rvData['sender']['role'] = 'owner' + if 'role' in eventObj.plugin_event.data.sender: + eventObj.rvData['sender']['role'] = eventObj.plugin_event.data.sender['role'] updateHostIdDict( botHash = eventObj.plugin_event.bot_info.hash, hostId = eventObj.plugin_event.data.host_id, @@ -221,7 +224,7 @@ def private_message(eventObj): eventObj.rvData['raw_message'] = paraMapper(eventObj.plugin_event.data.raw_message.data) eventObj.rvData['font'] = eventObj.plugin_event.data.font eventObj.rvData['sender'] = {} - eventObj.rvData['sender']['user_id'] = eventObj.plugin_event.data.sender['id'] + eventObj.rvData['sender']['user_id'] = int(eventObj.plugin_event.data.sender['id']) eventObj.rvData['sender']['nickname'] = eventObj.plugin_event.data.sender['name'] class txEvent(object): @@ -270,7 +273,6 @@ def doInit(self): ) def doRouter(self): - #print(self.json) try: if self.active: if hasattr(actionRouter, self.funcType):