fix: 表情列表改为正序输出,每个表情单独一条消息 (#222)

This commit is contained in:
sameu 2023-08-14 02:40:12 +08:00 committed by GitHub
parent 9b9ec42ffa
commit 9df10b9bb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -712,16 +712,17 @@ export class add extends plugin {
let keyWord = await this.keyWordTran(arr[i].key)
if (!keyWord) continue
let result = []
if (Array.isArray(keyWord)) {
keyWord.unshift(`${arr[i].num}`)
keyWord.unshift(`${num + 1}`)
keyWord.push('\n')
keyWord.forEach(v => msg.push(v))
result.push(...keyWord)
} else if (keyWord.type) {
msg.push(`\n${arr[i].num}`, keyWord, '\n\n')
result.push(`\n${num + 1}`, keyWord, '\n\n')
} else {
msg.push(`${arr[i].num}${keyWord}\n`)
result.push(`${num + 1}${keyWord}\n`)
}
msg.push(result)
num++
}
@ -734,7 +735,7 @@ export class add extends plugin {
title = `表情${search}${count}`
}
let forwardMsg = await common.makeForwardMsg(this.e, [title, msg], title)
let forwardMsg = await common.makeForwardMsg(this.e, [title, ...msg], title)
this.e.reply(forwardMsg)
}
@ -778,4 +779,4 @@ export class add extends plugin {
return msg
}
}
}