feat: 添加makeForwardMsg消息伪装开关 (#167)

This commit is contained in:
sameu 2023-06-07 04:52:25 +08:00 committed by GitHub
parent 765719533f
commit cc91a4c84e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -64,28 +64,28 @@ function mkdirs (dirname) {
* @param e icqq消息e * @param e icqq消息e
* @param msg 消息数组 * @param msg 消息数组
* @param dec 转发描述 * @param dec 转发描述
* @param msgsscr 转发信息是否为Bot
*/ */
async function makeForwardMsg (e, msg = [], dec = '') { async function makeForwardMsg (e, msg = [], dec = '', msgsscr = false) {
// 是频道直接返回 join // 是频道直接返回 join
if (e.isGuild) return msg.join("\n") if (e.isGuild) return msg.join("\n")
let nickname = e.bot.nickname let name = msgsscr ? this.e.sender.card || this.e.user_id : Bot.nickname
let id = msgsscr ? this.e.user_id : Bot.uin
if (e.isGroup) { if (e.isGroup) {
let info = await e.bot.getGroupMemberInfo(e.group_id, e.bot.uin) let info = await e.bot.getGroupMemberInfo(e.group_id, e.bot.uin)
nickname = info.card || info.nickname
} }
let userInfo = { let userInfo = {
user_id: e.bot.uin, user_id: id
nickname nickname: name
} }
let forwardMsg = [] let forwardMsg = []
msg.forEach(v => { msg.forEach(msg => {
forwardMsg.push({ forwardMsg.push({
...userInfo, ...userInfo,
message: v message: msg
}) })
}) })