优化
This commit is contained in:
@ -23,8 +23,8 @@ module.exports = function sendForwardMessage(bot, data) {
|
||||
if (imgUrls) {
|
||||
Array.isArray(imgUrls)
|
||||
? imgUrls
|
||||
.slice(0, process.env.IMG_NUMBER_IN_ONE_MESSAGE || 1)
|
||||
.forEach((url) => msgContent.addImageUrl(url))
|
||||
.slice(0, process.env.IMG_NUMBER_IN_ONE_MESSAGE || 1)
|
||||
.forEach((url) => msgContent.addImageUrl(url))
|
||||
: msgContent.addImageUrl(imgUrls);
|
||||
}
|
||||
// 添加来源地址
|
||||
@ -34,7 +34,7 @@ module.exports = function sendForwardMessage(bot, data) {
|
||||
forwardMsgContent.addForwardNode({
|
||||
senderId: process.env.QQ,
|
||||
time: 0,
|
||||
senderName: process.env.FORWARD_SENDER_NAME || '莉娜·模儿',
|
||||
senderName: from || process.env.FORWARD_SENDER_NAME || '莉娜·模儿',
|
||||
messageChain: msgContent,
|
||||
});
|
||||
}
|
||||
@ -42,23 +42,23 @@ module.exports = function sendForwardMessage(bot, data) {
|
||||
Array.isArray(groups) &&
|
||||
groups.forEach((groupId) => {
|
||||
// 添加消息来源
|
||||
if (from) {
|
||||
bot.sendMessageToGroup(
|
||||
groupId,
|
||||
new Message().addText(`${from}更新啦!快来看吧。`),
|
||||
);
|
||||
}
|
||||
// if (from) {
|
||||
// bot.sendMessageToGroup(
|
||||
// groupId,
|
||||
// new Message().addText(`${from}更新啦!快来看吧。`),
|
||||
// );
|
||||
// }
|
||||
bot.sendMessageToGroup(groupId, forwardMsgContent);
|
||||
});
|
||||
Array.isArray(users) &&
|
||||
users.forEach((qq) => {
|
||||
// 添加消息来源
|
||||
if (from) {
|
||||
bot.sendMessageToFriend(
|
||||
qq,
|
||||
new Message().addText(`${from}更新啦!快来看吧。`),
|
||||
);
|
||||
}
|
||||
// if (from) {
|
||||
// bot.sendMessageToFriend(
|
||||
// qq,
|
||||
// new Message().addText(`${from}更新啦!快来看吧。`),
|
||||
// );
|
||||
// }
|
||||
bot.sendMessageToFriend(qq, forwardMsgContent);
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user