From 815613bbbe2994ff4f722a17706c142b1e7fb6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=AE=E5=B8=AE?= <3102509561@qq.com> Date: Sat, 5 Aug 2023 11:38:26 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=85=AC=E5=91=8A?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=A0=87=E9=A2=98=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 帮帮 <3102509561@qq.com> --- plugins/genshin/apps/mysNews.js | 2 ++ plugins/genshin/model/mysNews.js | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/genshin/apps/mysNews.js b/plugins/genshin/apps/mysNews.js index 7c5eb19..850fc17 100644 --- a/plugins/genshin/apps/mysNews.js +++ b/plugins/genshin/apps/mysNews.js @@ -126,6 +126,8 @@ export class mysNews extends plugin { model = '关闭' msg += `${model}` cfg[type][this.e.self_id] = lodash.difference(cfg[type][this.e.self_id], [this.e.group_id]) + if (lodash.isEmpty(cfg[type][this.e.self_id])) + delete cfg[type][this.e.self_id] } let yaml = YAML.stringify(cfg) diff --git a/plugins/genshin/model/mysNews.js b/plugins/genshin/model/mysNews.js index 96132c6..be5f601 100644 --- a/plugins/genshin/model/mysNews.js +++ b/plugins/genshin/model/mysNews.js @@ -257,14 +257,13 @@ export default class MysNews extends base { return this.replyMsg(img, `${param.data.post.subject}`) } - replyMsg(img, title = '') { + replyMsg(img, title) { if (!img || img.length <= 0) return false if (img.length == 1) { - if (title) img.unshift(title) + if (title) return [title, ...img] return img - } else { - return common.makeForwardMsg(this.e, img, title) } + return common.makeForwardMsg(this.e, img, title) } async mysNewsTask() {