🎨 不强制将图文转MD, 并支持本地图发送

This commit is contained in:
KimigaiiWuyi 2024-08-21 02:30:04 +08:00
parent da8a127bc2
commit 45174e5d33

View File

@ -1091,21 +1091,16 @@ async def group_send(
if img: if img:
if img.startswith('link://'): if img.startswith('link://'):
_img = img.replace('link://', '') _img = img.replace('link://', '')
message.append(MessageSegment.image(_img))
else: else:
logger.warning( message.append(
'[gscore] qqgroup暂不支持发送本地图信息, 请转为URL发送' MessageSegment.file_image(
base64.b64decode(img.replace('base64://', ''))
)
) )
return
else:
_img = ''
if text and img: if text:
data = f'{text}\n{_img}'
message.append(MessageSegment.markdown(data))
elif text:
message.append(MessageSegment.text(text)) message.append(MessageSegment.text(text))
elif _img:
message.append(MessageSegment.image(_img))
if template_markdown: if template_markdown:
message.append( message.append(
@ -1368,7 +1363,11 @@ async def telegram_send(
_t = [] _t = []
reply_markup = InlineKeyboardMarkup(inline_keyboard=kb) reply_markup = InlineKeyboardMarkup(inline_keyboard=kb)
await bot.send_to(target_id, message, reply_markup=reply_markup) await bot.send_to(
target_id,
message,
reply_markup=reply_markup,
)
if node: if node:
for _msg in node: for _msg in node: