From f66b4a8548dc87daa36a00a138d02b5d2f20d083 Mon Sep 17 00:00:00 2001 From: zyc404 Date: Wed, 8 May 2024 00:23:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=86=E9=A2=91=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=BB=B6=E8=BF=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/BingSuno.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/BingSuno.js b/utils/BingSuno.js index b126148..25c4b1b 100644 --- a/utils/BingSuno.js +++ b/utils/BingSuno.js @@ -16,7 +16,7 @@ export default class BingSunoClient { messages.push(`歌名:${song.title}\n风格: ${song.musicalStyle}\n歌词:\n${song.prompt}\n`) messages.push(`音频链接:${song.audioURL}\n视频链接:${song.videoURL}\n封面链接:${song.imageURL}\n`) messages.push(segment.image(song.imageURL)) - let retry = 3 + let retry = 10 let videoPath while (!videoPath && retry >= 0) { try { @@ -25,12 +25,12 @@ export default class BingSunoClient { }) } catch (err) { retry-- - await common.sleep(1000) + await common.sleep(3000) } } if (videoPath) { const data = fs.readFileSync(videoPath) - messages.push(segment.video(`base64://${data.toString('base64')}`)) + await e.reply(segment.video(`base64://${data.toString('base64')}`)) // 60秒后删除文件避免占用体积 setTimeout(() => { fs.unlinkSync(videoPath)