!72 修复 公告推送标题重复

Merge pull request !72 from 帮帮/N/A
This commit is contained in:
Kokomi 2023-08-06 06:44:19 +00:00 committed by Gitee
commit 59cbe2fd79
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() {