修复 公告推送标题重复

Signed-off-by: 帮帮 <3102509561@qq.com>
This commit is contained in:
帮帮 2023-08-05 11:38:26 +00:00 committed by Gitee
parent c3efed3c53
commit 815613bbbe
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 4 deletions

View File

@ -126,6 +126,8 @@ export class mysNews extends plugin {
model = '关闭' model = '关闭'
msg += `${model}` msg += `${model}`
cfg[type][this.e.self_id] = lodash.difference(cfg[type][this.e.self_id], [this.e.group_id]) 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) let yaml = YAML.stringify(cfg)

View File

@ -257,14 +257,13 @@ export default class MysNews extends base {
return this.replyMsg(img, `${param.data.post.subject}`) return this.replyMsg(img, `${param.data.post.subject}`)
} }
replyMsg(img, title = '') { replyMsg(img, title) {
if (!img || img.length <= 0) return false if (!img || img.length <= 0) return false
if (img.length == 1) { if (img.length == 1) {
if (title) img.unshift(title) if (title) return [title, ...img]
return img return img
} else {
return common.makeForwardMsg(this.e, img, title)
} }
return common.makeForwardMsg(this.e, img, title)
} }
async mysNewsTask() { async mysNewsTask() {