mirror of
https://github.com/Xtao-Labs/iShotaBot.git
synced 2024-11-25 09:37:34 +00:00
⚡ 优化 audio caption
This commit is contained in:
parent
39c726a8bc
commit
a93093ea80
@ -236,9 +236,13 @@ async def audio_download(a: Audio, m: Message):
|
|||||||
thumb.seek(0)
|
thumb.seek(0)
|
||||||
else:
|
else:
|
||||||
thumb = None
|
thumb = None
|
||||||
text = f"<b>{info['title']}</b>\n\n{info.get('desc', '')}\n\nhttps://www.bilibili.com/audio/au{a.get_auid()}"
|
intro = info.get("intro", "")
|
||||||
if len(text) > 800:
|
if intro:
|
||||||
text = f"<b>{info['title']}</b>\n\n简介过长,无法显示\n\nhttps://www.bilibili.com/audio/au{a.get_auid()}"
|
text = f"<b>{info['title']}</b>\n\n{intro}\n\nhttps://www.bilibili.com/audio/au{a.get_auid()}"
|
||||||
|
if len(text) > 800:
|
||||||
|
text = f"<b>{info['title']}</b>\n\n简介过长,无法显示\n\nhttps://www.bilibili.com/audio/au{a.get_auid()}"
|
||||||
|
else:
|
||||||
|
text = f"<b>{info['title']}</b>\n\nhttps://www.bilibili.com/audio/au{a.get_auid()}"
|
||||||
await bot.send_audio(
|
await bot.send_audio(
|
||||||
chat_id=m.chat.id,
|
chat_id=m.chat.id,
|
||||||
audio=media,
|
audio=media,
|
||||||
@ -246,6 +250,7 @@ async def audio_download(a: Audio, m: Message):
|
|||||||
parse_mode=ParseMode.HTML,
|
parse_mode=ParseMode.HTML,
|
||||||
reply_to_message_id=m.reply_to_message_id,
|
reply_to_message_id=m.reply_to_message_id,
|
||||||
thumb=thumb,
|
thumb=thumb,
|
||||||
|
title=info.get("title"),
|
||||||
duration=info.get("duration"),
|
duration=info.get("duration"),
|
||||||
performer=info.get("author"),
|
performer=info.get("author"),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user