🎨 引入ev.real_bot_id解决同个应用端但不同协议的问题

This commit is contained in:
KimigaiiWuyi 2023-09-22 01:15:51 +08:00
parent e101d942a2
commit 0e54c60b63
3 changed files with 10 additions and 3 deletions

View File

@ -139,7 +139,7 @@ class Bot:
message,
self.ev.user_type,
self.ev.group_id if self.ev.group_id else self.ev.user_id,
self.ev.bot_id,
self.ev.real_bot_id,
self.bot_self_id,
self.ev.msg_id,
at_sender,
@ -158,7 +158,7 @@ class Bot:
message,
target_type,
target_id,
self.ev.bot_id,
self.ev.real_bot_id,
self.ev.bot_self_id,
self.ev.msg_id,
at_sender,

View File

@ -24,14 +24,20 @@ async def get_user_pml(msg: MessageReceive) -> int:
async def msg_process(msg: MessageReceive) -> Event:
if ':' in msg.bot_id:
bot_id = msg.bot_id.split(':')[0]
else:
bot_id = msg.bot_id
event = Event(
msg.bot_id,
bot_id,
msg.bot_self_id,
msg.msg_id,
msg.user_type,
msg.group_id,
msg.user_id,
msg.user_pm,
real_bot_id=msg.bot_id,
)
_content: List[Message] = []
for _msg in msg.content:

View File

@ -20,6 +20,7 @@ class MessageReceive(Struct):
class Event(MessageReceive):
real_bot_id: str = ''
raw_text: str = ''
command: str = ''
text: str = ''