mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
Merge pull request #224 from LLOneBot/dev
Fix: #219,发送视频图片进行文件大小判断,超时时间根据文件大小(512kb/s)动态调整
This commit is contained in:
commit
627042fd25
@ -76,8 +76,9 @@ export class SendMsgElementConstructor {
|
|||||||
if (fileSize === 0) {
|
if (fileSize === 0) {
|
||||||
throw '文件异常,大小为0'
|
throw '文件异常,大小为0'
|
||||||
}
|
}
|
||||||
if (fileSize > 1000 * 1000 * 7){ // todo: 没有采用1024计算,因为具体上限数值未知,大概是7MB
|
const maxMB = 30;
|
||||||
throw `图片过大,最大支持7MB,当前文件大小${fileSize}B`
|
if (fileSize > 1024 * 1024 * 30){
|
||||||
|
throw `图片过大,最大支持${maxMB}MB,当前文件大小${fileSize}B`
|
||||||
}
|
}
|
||||||
const imageSize = await NTQQFileApi.getImageSize(picPath)
|
const imageSize = await NTQQFileApi.getImageSize(picPath)
|
||||||
const picElement = {
|
const picElement = {
|
||||||
@ -134,8 +135,9 @@ export class SendMsgElementConstructor {
|
|||||||
if (fileSize === 0) {
|
if (fileSize === 0) {
|
||||||
throw '文件异常,大小为0'
|
throw '文件异常,大小为0'
|
||||||
}
|
}
|
||||||
if (fileSize > 1000 * 1000 * 100) { // todo: 没有采用1024计算,因为具体上限数值未知,大概是100MB
|
const maxMB = 100;
|
||||||
throw `视频过大,最大支持100MB,当前文件大小${fileSize}B`
|
if (fileSize > 1024 * 1024 * maxMB) {
|
||||||
|
throw `视频过大,最大支持${maxMB}MB,当前文件大小${fileSize}B`
|
||||||
}
|
}
|
||||||
const pathLib = require('path')
|
const pathLib = require('path')
|
||||||
let thumbDir = path.replace(`${pathLib.sep}Ori${pathLib.sep}`, `${pathLib.sep}Thumb${pathLib.sep}`)
|
let thumbDir = path.replace(`${pathLib.sep}Ori${pathLib.sep}`, `${pathLib.sep}Thumb${pathLib.sep}`)
|
||||||
|
@ -50,22 +50,28 @@ function checkSendMessage(sendMsgList: OB11MessageData[]) {
|
|||||||
let data = msg['data']
|
let data = msg['data']
|
||||||
if (type === 'text' && !data['text']) {
|
if (type === 'text' && !data['text']) {
|
||||||
return 400
|
return 400
|
||||||
} else if (['image', 'voice', 'record'].includes(type)) {
|
}
|
||||||
|
else if (['image', 'voice', 'record'].includes(type)) {
|
||||||
if (!data['file']) {
|
if (!data['file']) {
|
||||||
return 400
|
return 400
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (checkUri(data['file'])) {
|
if (checkUri(data['file'])) {
|
||||||
return 200
|
return 200
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return 400
|
return 400
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (type === 'at' && !data['qq']) {
|
}
|
||||||
return 400
|
else if (type === 'at' && !data['qq']) {
|
||||||
} else if (type === 'reply' && !data['id']) {
|
|
||||||
return 400
|
return 400
|
||||||
}
|
}
|
||||||
} else {
|
else if (type === 'reply' && !data['id']) {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
return 400
|
return 400
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,10 +93,12 @@ export function convertMessage2List(message: OB11MessageMixType, autoEscape = fa
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
message = decodeCQCode(message.toString())
|
message = decodeCQCode(message.toString())
|
||||||
}
|
}
|
||||||
} else if (!Array.isArray(message)) {
|
}
|
||||||
|
else if (!Array.isArray(message)) {
|
||||||
message = [message]
|
message = [message]
|
||||||
}
|
}
|
||||||
return message
|
return message
|
||||||
@ -108,179 +116,177 @@ export async function createSendElements(
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
switch (sendMsg.type) {
|
switch (sendMsg.type) {
|
||||||
case OB11MessageDataType.text:
|
case OB11MessageDataType.text: {
|
||||||
{
|
const text = sendMsg.data?.text
|
||||||
const text = sendMsg.data?.text
|
if (text) {
|
||||||
if (text) {
|
sendElements.push(SendMsgElementConstructor.text(sendMsg.data!.text))
|
||||||
sendElements.push(SendMsgElementConstructor.text(sendMsg.data!.text))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case OB11MessageDataType.at:
|
case OB11MessageDataType.at: {
|
||||||
{
|
if (!target) {
|
||||||
if (!target) {
|
continue
|
||||||
continue
|
}
|
||||||
|
let atQQ = sendMsg.data?.qq
|
||||||
|
if (atQQ) {
|
||||||
|
atQQ = atQQ.toString()
|
||||||
|
if (atQQ === 'all') {
|
||||||
|
// todo:查询剩余的at全体次数
|
||||||
|
const groupCode = (target as Group)?.groupCode
|
||||||
|
let remainAtAllCount = 1
|
||||||
|
let isAdmin: boolean = true
|
||||||
|
if (groupCode) {
|
||||||
|
try {
|
||||||
|
remainAtAllCount = (await NTQQGroupApi.getGroupAtAllRemainCount(groupCode)).atInfo
|
||||||
|
.RemainAtAllCountForUin
|
||||||
|
log(`群${groupCode}剩余at全体次数`, remainAtAllCount)
|
||||||
|
const self = await getGroupMember((target as Group)?.groupCode, selfInfo.uin)
|
||||||
|
isAdmin = self.role === GroupMemberRole.admin || self.role === GroupMemberRole.owner
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isAdmin && remainAtAllCount > 0) {
|
||||||
|
sendElements.push(SendMsgElementConstructor.at(atQQ, atQQ, AtType.atAll, '全体成员'))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let atQQ = sendMsg.data?.qq
|
else {
|
||||||
if (atQQ) {
|
// const atMember = group?.members.find(m => m.uin == atQQ)
|
||||||
atQQ = atQQ.toString()
|
const atMember = await getGroupMember((target as Group)?.groupCode, atQQ)
|
||||||
if (atQQ === 'all') {
|
if (atMember) {
|
||||||
// todo:查询剩余的at全体次数
|
sendElements.push(
|
||||||
const groupCode = (target as Group)?.groupCode
|
SendMsgElementConstructor.at(atQQ, atMember.uid, AtType.atUser, atMember.cardName || atMember.nick),
|
||||||
let remainAtAllCount = 1
|
)
|
||||||
let isAdmin: boolean = true
|
|
||||||
if (groupCode) {
|
|
||||||
try {
|
|
||||||
remainAtAllCount = (await NTQQGroupApi.getGroupAtAllRemainCount(groupCode)).atInfo
|
|
||||||
.RemainAtAllCountForUin
|
|
||||||
log(`群${groupCode}剩余at全体次数`, remainAtAllCount)
|
|
||||||
const self = await getGroupMember((target as Group)?.groupCode, selfInfo.uin)
|
|
||||||
isAdmin = self.role === GroupMemberRole.admin || self.role === GroupMemberRole.owner
|
|
||||||
} catch (e) {}
|
|
||||||
}
|
|
||||||
if (isAdmin && remainAtAllCount > 0) {
|
|
||||||
sendElements.push(SendMsgElementConstructor.at(atQQ, atQQ, AtType.atAll, '全体成员'))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// const atMember = group?.members.find(m => m.uin == atQQ)
|
|
||||||
const atMember = await getGroupMember((target as Group)?.groupCode, atQQ)
|
|
||||||
if (atMember) {
|
|
||||||
sendElements.push(
|
|
||||||
SendMsgElementConstructor.at(atQQ, atMember.uid, AtType.atUser, atMember.cardName || atMember.nick),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case OB11MessageDataType.reply:
|
case OB11MessageDataType.reply: {
|
||||||
{
|
let replyMsgId = sendMsg.data.id
|
||||||
let replyMsgId = sendMsg.data.id
|
if (replyMsgId) {
|
||||||
if (replyMsgId) {
|
const replyMsg = await dbUtil.getMsgByShortId(parseInt(replyMsgId))
|
||||||
const replyMsg = await dbUtil.getMsgByShortId(parseInt(replyMsgId))
|
if (replyMsg) {
|
||||||
if (replyMsg) {
|
sendElements.push(
|
||||||
|
SendMsgElementConstructor.reply(
|
||||||
|
replyMsg.msgSeq,
|
||||||
|
replyMsg.msgId,
|
||||||
|
replyMsg.senderUin,
|
||||||
|
replyMsg.senderUin,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case OB11MessageDataType.face: {
|
||||||
|
const faceId = sendMsg.data?.id
|
||||||
|
if (faceId) {
|
||||||
|
sendElements.push(SendMsgElementConstructor.face(parseInt(faceId)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case OB11MessageDataType.mface: {
|
||||||
|
sendElements.push(
|
||||||
|
SendMsgElementConstructor.mface(
|
||||||
|
sendMsg.data.emoji_package_id,
|
||||||
|
sendMsg.data.emoji_id,
|
||||||
|
sendMsg.data.key,
|
||||||
|
sendMsg.data.summary,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case OB11MessageDataType.image:
|
||||||
|
case OB11MessageDataType.file:
|
||||||
|
case OB11MessageDataType.video:
|
||||||
|
case OB11MessageDataType.voice: {
|
||||||
|
const data = (sendMsg as OB11MessageFile).data
|
||||||
|
let file = data.file
|
||||||
|
const payloadFileName = data?.name
|
||||||
|
if (file) {
|
||||||
|
const cache = await dbUtil.getFileCache(file)
|
||||||
|
if (cache) {
|
||||||
|
if (fs.existsSync(cache.filePath)) {
|
||||||
|
file = 'file://' + cache.filePath
|
||||||
|
}
|
||||||
|
else if (cache.downloadFunc) {
|
||||||
|
await cache.downloadFunc()
|
||||||
|
file = cache.filePath
|
||||||
|
}
|
||||||
|
else if (cache.url) {
|
||||||
|
file = cache.url
|
||||||
|
}
|
||||||
|
log('找到文件缓存', file)
|
||||||
|
}
|
||||||
|
const { path, isLocal, fileName, errMsg } = await uri2local(file)
|
||||||
|
if (errMsg) {
|
||||||
|
throw errMsg
|
||||||
|
}
|
||||||
|
if (path) {
|
||||||
|
if (!isLocal) {
|
||||||
|
// 只删除http和base64转过来的文件
|
||||||
|
deleteAfterSentFiles.push(path)
|
||||||
|
}
|
||||||
|
if (sendMsg.type === OB11MessageDataType.file) {
|
||||||
|
log('发送文件', path, payloadFileName || fileName)
|
||||||
|
sendElements.push(await SendMsgElementConstructor.file(path, payloadFileName || fileName))
|
||||||
|
}
|
||||||
|
else if (sendMsg.type === OB11MessageDataType.video) {
|
||||||
|
log('发送视频', path, payloadFileName || fileName)
|
||||||
|
let thumb = sendMsg.data?.thumb
|
||||||
|
if (thumb) {
|
||||||
|
let uri2LocalRes = await uri2local(thumb)
|
||||||
|
if (uri2LocalRes.success) {
|
||||||
|
thumb = uri2LocalRes.path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sendElements.push(await SendMsgElementConstructor.video(path, payloadFileName || fileName, thumb))
|
||||||
|
}
|
||||||
|
else if (sendMsg.type === OB11MessageDataType.voice) {
|
||||||
|
sendElements.push(await SendMsgElementConstructor.ptt(path))
|
||||||
|
}
|
||||||
|
else if (sendMsg.type === OB11MessageDataType.image) {
|
||||||
sendElements.push(
|
sendElements.push(
|
||||||
SendMsgElementConstructor.reply(
|
await SendMsgElementConstructor.pic(
|
||||||
replyMsg.msgSeq,
|
path,
|
||||||
replyMsg.msgId,
|
sendMsg.data.summary || '',
|
||||||
replyMsg.senderUin,
|
<PicSubType>parseInt(sendMsg.data?.subType?.toString()) || 0,
|
||||||
replyMsg.senderUin,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case OB11MessageDataType.face:
|
case OB11MessageDataType.json: {
|
||||||
{
|
sendElements.push(SendMsgElementConstructor.ark(sendMsg.data.data))
|
||||||
const faceId = sendMsg.data?.id
|
}
|
||||||
if (faceId) {
|
break
|
||||||
sendElements.push(SendMsgElementConstructor.face(parseInt(faceId)))
|
case OB11MessageDataType.poke: {
|
||||||
|
let qq = sendMsg.data?.qq || sendMsg.data?.id
|
||||||
|
if (qq) {
|
||||||
|
if ('groupCode' in target) {
|
||||||
|
crychic.sendGroupPoke(target.groupCode, qq.toString())
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
break
|
if (!qq) {
|
||||||
case OB11MessageDataType.mface:
|
qq = parseInt(target.uin)
|
||||||
{
|
|
||||||
sendElements.push(
|
|
||||||
SendMsgElementConstructor.mface(
|
|
||||||
sendMsg.data.emoji_package_id,
|
|
||||||
sendMsg.data.emoji_id,
|
|
||||||
sendMsg.data.key,
|
|
||||||
sendMsg.data.summary,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case OB11MessageDataType.image:
|
|
||||||
case OB11MessageDataType.file:
|
|
||||||
case OB11MessageDataType.video:
|
|
||||||
case OB11MessageDataType.voice:
|
|
||||||
{
|
|
||||||
const data = (sendMsg as OB11MessageFile).data
|
|
||||||
let file = data.file
|
|
||||||
const payloadFileName = data?.name
|
|
||||||
if (file) {
|
|
||||||
const cache = await dbUtil.getFileCache(file)
|
|
||||||
if (cache) {
|
|
||||||
if (fs.existsSync(cache.filePath)) {
|
|
||||||
file = 'file://' + cache.filePath
|
|
||||||
} else if (cache.downloadFunc) {
|
|
||||||
await cache.downloadFunc()
|
|
||||||
file = cache.filePath
|
|
||||||
} else if (cache.url) {
|
|
||||||
file = cache.url
|
|
||||||
}
|
|
||||||
log('找到文件缓存', file)
|
|
||||||
}
|
|
||||||
const { path, isLocal, fileName, errMsg } = await uri2local(file)
|
|
||||||
if (errMsg) {
|
|
||||||
throw errMsg
|
|
||||||
}
|
|
||||||
if (path) {
|
|
||||||
if (!isLocal) {
|
|
||||||
// 只删除http和base64转过来的文件
|
|
||||||
deleteAfterSentFiles.push(path)
|
|
||||||
}
|
|
||||||
if (sendMsg.type === OB11MessageDataType.file) {
|
|
||||||
log('发送文件', path, payloadFileName || fileName)
|
|
||||||
sendElements.push(await SendMsgElementConstructor.file(path, payloadFileName || fileName))
|
|
||||||
} else if (sendMsg.type === OB11MessageDataType.video) {
|
|
||||||
log('发送视频', path, payloadFileName || fileName)
|
|
||||||
let thumb = sendMsg.data?.thumb
|
|
||||||
if (thumb) {
|
|
||||||
let uri2LocalRes = await uri2local(thumb)
|
|
||||||
if (uri2LocalRes.success) {
|
|
||||||
thumb = uri2LocalRes.path
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sendElements.push(await SendMsgElementConstructor.video(path, payloadFileName || fileName, thumb))
|
|
||||||
} else if (sendMsg.type === OB11MessageDataType.voice) {
|
|
||||||
sendElements.push(await SendMsgElementConstructor.ptt(path))
|
|
||||||
} else if (sendMsg.type === OB11MessageDataType.image) {
|
|
||||||
sendElements.push(
|
|
||||||
await SendMsgElementConstructor.pic(
|
|
||||||
path,
|
|
||||||
sendMsg.data.summary || '',
|
|
||||||
<PicSubType>parseInt(sendMsg.data?.subType?.toString()) || 0,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
crychic.sendFriendPoke(qq.toString())
|
||||||
}
|
}
|
||||||
|
sendElements.push(SendMsgElementConstructor.poke('', ''))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case OB11MessageDataType.json:
|
case OB11MessageDataType.dice: {
|
||||||
{
|
const resultId = sendMsg.data?.result
|
||||||
sendElements.push(SendMsgElementConstructor.ark(sendMsg.data.data))
|
sendElements.push(SendMsgElementConstructor.dice(resultId))
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case OB11MessageDataType.poke:
|
case OB11MessageDataType.RPS: {
|
||||||
{
|
const resultId = sendMsg.data?.result
|
||||||
let qq = sendMsg.data?.qq || sendMsg.data?.id
|
sendElements.push(SendMsgElementConstructor.rps(resultId))
|
||||||
if (qq) {
|
}
|
||||||
if ('groupCode' in target) {
|
|
||||||
crychic.sendGroupPoke(target.groupCode, qq.toString())
|
|
||||||
} else {
|
|
||||||
if (!qq) {
|
|
||||||
qq = parseInt(target.uin)
|
|
||||||
}
|
|
||||||
crychic.sendFriendPoke(qq.toString())
|
|
||||||
}
|
|
||||||
sendElements.push(SendMsgElementConstructor.poke('', ''))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case OB11MessageDataType.dice:
|
|
||||||
{
|
|
||||||
const resultId = sendMsg.data?.result
|
|
||||||
sendElements.push(SendMsgElementConstructor.dice(resultId))
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case OB11MessageDataType.RPS:
|
|
||||||
{
|
|
||||||
const resultId = sendMsg.data?.result
|
|
||||||
sendElements.push(SendMsgElementConstructor.rps(resultId))
|
|
||||||
}
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -300,10 +306,34 @@ export async function sendMsg(
|
|||||||
if (!sendElements.length) {
|
if (!sendElements.length) {
|
||||||
throw '消息体无法解析,请检查是否发送了不支持的消息类型'
|
throw '消息体无法解析,请检查是否发送了不支持的消息类型'
|
||||||
}
|
}
|
||||||
const returnMsg = await NTQQMsgApi.sendMsg(peer, sendElements, waitComplete, 20000)
|
// 计算发送的文件大小
|
||||||
|
let totalSize = 0
|
||||||
|
for (const fileElement of sendElements) {
|
||||||
|
try {
|
||||||
|
if (fileElement.elementType === ElementType.PTT) {
|
||||||
|
totalSize += fs.statSync(fileElement.pttElement.filePath).size
|
||||||
|
}
|
||||||
|
if (fileElement.elementType === ElementType.FILE) {
|
||||||
|
totalSize += fs.statSync(fileElement.fileElement.filePath).size
|
||||||
|
}
|
||||||
|
if (fileElement.elementType === ElementType.VIDEO) {
|
||||||
|
totalSize += fs.statSync(fileElement.videoElement.filePath).size
|
||||||
|
}
|
||||||
|
if (fileElement.elementType === ElementType.PIC) {
|
||||||
|
totalSize += fs.statSync(fileElement.picElement.sourcePath).size
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
log('文件大小计算失败', e, fileElement)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log('发送消息总大小', totalSize, 'bytes')
|
||||||
|
let timeout = ((totalSize / 1024 / 512) * 1000) || 5000 // 512kb/s
|
||||||
|
log('设置消息超时时间', timeout)
|
||||||
|
const returnMsg = await NTQQMsgApi.sendMsg(peer, sendElements, waitComplete, timeout)
|
||||||
log('消息发送结果', returnMsg)
|
log('消息发送结果', returnMsg)
|
||||||
returnMsg.msgShortId = await dbUtil.addMsg(returnMsg)
|
returnMsg.msgShortId = await dbUtil.addMsg(returnMsg)
|
||||||
deleteAfterSentFiles.map((f) => fs.unlink(f, () => {}))
|
deleteAfterSentFiles.map((f) => fs.unlink(f, () => {
|
||||||
|
}))
|
||||||
return returnMsg
|
return returnMsg
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,7 +432,8 @@ export class SendMsg extends BaseAction<OB11PostSendMsg, ReturnDataType> {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw '发送转发消息失败 ' + e.toString()
|
throw '发送转发消息失败 ' + e.toString()
|
||||||
}
|
}
|
||||||
} else if (this.getSpecialMsgNum(messages, OB11MessageDataType.music)) {
|
}
|
||||||
|
else if (this.getSpecialMsgNum(messages, OB11MessageDataType.music)) {
|
||||||
const music = messages[0] as OB11MessageMusic
|
const music = messages[0] as OB11MessageMusic
|
||||||
if (music) {
|
if (music) {
|
||||||
const { musicSignUrl } = getConfigUtil().getConfig()
|
const { musicSignUrl } = getConfigUtil().getConfig()
|
||||||
@ -439,7 +470,7 @@ export class SendMsg extends BaseAction<OB11PostSendMsg, ReturnDataType> {
|
|||||||
let jsonContent: string
|
let jsonContent: string
|
||||||
try {
|
try {
|
||||||
jsonContent = await new MusicSign(musicSignUrl).sign(postData)
|
jsonContent = await new MusicSign(musicSignUrl).sign(postData)
|
||||||
if (!jsonContent){
|
if (!jsonContent) {
|
||||||
throw '音乐消息生成失败,提交内容有误或者签名服务器签名失败'
|
throw '音乐消息生成失败,提交内容有误或者签名服务器签名失败'
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -459,7 +490,8 @@ export class SendMsg extends BaseAction<OB11PostSendMsg, ReturnDataType> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const returnMsg = await sendMsg(peer, sendElements, deleteAfterSentFiles)
|
const returnMsg = await sendMsg(peer, sendElements, deleteAfterSentFiles)
|
||||||
deleteAfterSentFiles.map((f) => fs.unlink(f, () => {}))
|
deleteAfterSentFiles.map((f) => fs.unlink(f, () => {
|
||||||
|
}))
|
||||||
return { message_id: returnMsg.msgShortId }
|
return { message_id: returnMsg.msgShortId }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -562,7 +594,8 @@ export class SendMsg extends BaseAction<OB11PostSendMsg, ReturnDataType> {
|
|||||||
await sleep(500)
|
await sleep(500)
|
||||||
log('转发节点生成成功', nodeMsg.msgId)
|
log('转发节点生成成功', nodeMsg.msgId)
|
||||||
}
|
}
|
||||||
deleteAfterSentFiles.map((f) => fs.unlink(f, () => {}))
|
deleteAfterSentFiles.map((f) => fs.unlink(f, () => {
|
||||||
|
}))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('生成转发消息节点失败', e)
|
log('生成转发消息节点失败', e)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user