From 937e7a1507c2d205c13c80ee6de515b8676fd3df Mon Sep 17 00:00:00 2001 From: zhiyu1998 Date: Fri, 24 Mar 2023 14:44:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=84=20refactor:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=93=94=E5=93=A9=E5=93=94=E5=93=A9=E8=A7=A3=E6=9E=90=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 0a0b73a..48e910c 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -340,14 +340,13 @@ export class tools extends plugin { const dataProcessing = data => { return Number(data) >= TEN_THOUSAND ? (data / TEN_THOUSAND).toFixed(1) + "万" : data; }; - const combineContent = `总播放量:${dataProcessing(view)}, 弹幕数量:${dataProcessing( - danmaku, - )}, 回复量:${dataProcessing(reply)}, 收藏数:${dataProcessing( - favorite, - )}, 投币:${dataProcessing(coin)}, 分享:${dataProcessing(share)}, 点赞:${dataProcessing( - like, - )}\n`; - e.reply([`识别:哔哩哔哩:${title}\n${desc}\n`, combineContent]); + // 格式化数据 + const combineContent = + `标题:${title}\n` + + `点赞:${dataProcessing(like,)} | 硬币:${dataProcessing(coin)} | 收藏:${dataProcessing(favorite)} | 分享:${dataProcessing(share)}\n`+ + `总播放量:${dataProcessing(view)} | 弹幕数量:${dataProcessing(danmaku)} | 评论:${dataProcessing(reply)}\n`+ + `简介:${desc}`; + e.reply([`识别:哔哩哔哩:${title}`, combineContent]); await getDownloadUrl(url) .then(data => { @@ -369,7 +368,7 @@ export class tools extends plugin { if (this.biliSessData && this.openaiApiKey) { try { const prompt = await getBiliGptInputText( - { title, desc, dynamic, aid, cid }, + videoInfo, this.biliSessData, ); const response = await this.chatGptClient.sendMessage(prompt);