mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-12 06:55:58 +08:00
🐛 fix CQ Injection (#489)
This commit is contained in:
parent
13ce1fe4e2
commit
b43dd38b1d
@ -251,12 +251,13 @@ async def onebot_send(
|
|||||||
target_type: Optional[str],
|
target_type: Optional[str],
|
||||||
):
|
):
|
||||||
async def _send(content: Optional[str], image: Optional[str]):
|
async def _send(content: Optional[str], image: Optional[str]):
|
||||||
result_image = f'[CQ:image,file={image}]' if image else ''
|
from nonebot.adapters.onebot.v11 import MessageSegment
|
||||||
content = content if content else ''
|
result_image = MessageSegment.image(image) if image else ''
|
||||||
|
content = MessageSegment.text(content) if content else ''
|
||||||
result_msg = content + result_image
|
result_msg = content + result_image
|
||||||
if at_list and target_type == 'group':
|
if at_list and target_type == 'group':
|
||||||
for at in at_list:
|
for at in at_list:
|
||||||
result_msg += f'[CQ:at,qq={at}]'
|
result_msg += MessageSegment.at(at)
|
||||||
|
|
||||||
if file:
|
if file:
|
||||||
file_name, file_content = file.split('|')
|
file_name, file_content = file.split('|')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user