From 5b1c59dfabac89c26aba2db694563b4cbadea3b4 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Mon, 30 Sep 2024 13:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20pref:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=98=BFb=E7=9B=B4=E6=92=AD=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index fa299d9..8967ddd 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -75,7 +75,7 @@ import { downloadImg, estimateReadingTime, formatBiliInfo, - retryAxiosReq, + retryAxiosReq, saveJsonToFile, secondsToTime, testProxy, truncateString, @@ -542,12 +542,17 @@ export class tools extends plugin { // logger.info(streamId) // 提取相关信息 const liveData = await this.getBiliStream(streamId); - // logger.info(liveData); - const { title, user_cover, keyframe, description, tags } = liveData.data.data; + // saveJsonToFile(liveData.data); + const { title, user_cover, keyframe, description, tags, live_time, parent_area_name, area_name } = liveData.data.data; e.reply([ segment.image(user_cover), segment.image(keyframe), - `${this.identifyPrefix}识别:哔哩哔哩直播,${title}${description ? `\n\n简述:${description}\n` : ''}${tags ? `标签:${tags}\n` : ''}` + [`${ this.identifyPrefix }识别:哔哩哔哩直播,${ title }`, + `${ description ? `📝 简述:${ description.replace(`<p>`, '').replace(`</p>`, '') }` : '' }`, + `${ tags ? `🔖 标签:${ tags }` : '' }`, + `📍 分区:${ parent_area_name ? `${ parent_area_name }` : '' }${ area_name ? `-${ area_name }` : '' }`, + `${ live_time ? `⏰ 直播时间:${ live_time }` : '' }`, + ].filter(item => item.trim() !== "").join("\n") ]); return true; }