mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-12 06:55:58 +08:00
🐛 修复QQGuild的DMS发送
This commit is contained in:
parent
eaf6fc8ca3
commit
351ba571f2
@ -121,6 +121,7 @@ class GsClient:
|
|||||||
node = []
|
node = []
|
||||||
file = ''
|
file = ''
|
||||||
at_list = []
|
at_list = []
|
||||||
|
group_id = ''
|
||||||
if msg.content:
|
if msg.content:
|
||||||
for _c in msg.content:
|
for _c in msg.content:
|
||||||
if _c.data:
|
if _c.data:
|
||||||
@ -134,6 +135,8 @@ class GsClient:
|
|||||||
file = _c.data
|
file = _c.data
|
||||||
elif _c.type == 'at':
|
elif _c.type == 'at':
|
||||||
at_list.append(_c.data)
|
at_list.append(_c.data)
|
||||||
|
elif _c.type == 'group':
|
||||||
|
group_id = _c.data
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -187,6 +190,7 @@ class GsClient:
|
|||||||
msg.target_id,
|
msg.target_id,
|
||||||
msg.target_type,
|
msg.target_type,
|
||||||
msg.msg_id,
|
msg.msg_id,
|
||||||
|
group_id,
|
||||||
)
|
)
|
||||||
elif msg.bot_id == 'telegram':
|
elif msg.bot_id == 'telegram':
|
||||||
await telegram_send(
|
await telegram_send(
|
||||||
@ -364,6 +368,7 @@ async def guild_send(
|
|||||||
target_id: Optional[str],
|
target_id: Optional[str],
|
||||||
target_type: Optional[str],
|
target_type: Optional[str],
|
||||||
msg_id: Optional[str],
|
msg_id: Optional[str],
|
||||||
|
guild_id: Optional[str],
|
||||||
):
|
):
|
||||||
async def _send(content: Optional[str], image: Optional[str]):
|
async def _send(content: Optional[str], image: Optional[str]):
|
||||||
result: Dict[str, Any] = {'msg_id': msg_id}
|
result: Dict[str, Any] = {'msg_id': msg_id}
|
||||||
@ -382,9 +387,14 @@ async def guild_send(
|
|||||||
**result,
|
**result,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
dms = await bot.call_api(
|
||||||
|
'post_dms',
|
||||||
|
recipient_id=str(target_id),
|
||||||
|
source_guild_id=str(guild_id),
|
||||||
|
)
|
||||||
await bot.call_api(
|
await bot.call_api(
|
||||||
'post_dms_messages',
|
'post_dms_messages',
|
||||||
guild_id=int(target_id) if target_id else 0,
|
guild_id=dms.guild_id,
|
||||||
**result,
|
**result,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user