mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: 收到的文件没有删干净
This commit is contained in:
parent
2bfe9e236b
commit
49ba276f5d
@ -220,24 +220,23 @@ registerReceiveHook<{
|
|||||||
// 新消息
|
// 新消息
|
||||||
registerReceiveHook<{ msgList: Array<RawMessage> }>(ReceiveCmd.NEW_MSG, (payload) => {
|
registerReceiveHook<{ msgList: Array<RawMessage> }>(ReceiveCmd.NEW_MSG, (payload) => {
|
||||||
const {autoDeleteFile} = getConfigUtil().getConfig();
|
const {autoDeleteFile} = getConfigUtil().getConfig();
|
||||||
|
if (!autoDeleteFile) {
|
||||||
|
return
|
||||||
|
}
|
||||||
for (const message of payload.msgList) {
|
for (const message of payload.msgList) {
|
||||||
// log("收到新消息,push到历史记录", message.msgId)
|
// log("收到新消息,push到历史记录", message.msgId)
|
||||||
// dbUtil.addMsg(message).then()
|
// dbUtil.addMsg(message).then()
|
||||||
// 清理文件
|
// 清理文件
|
||||||
if (!autoDeleteFile) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for (const msgElement of message.elements) {
|
for (const msgElement of message.elements) {
|
||||||
if (msgElement.videoElement) {
|
|
||||||
log("收到视频消息", msgElement.videoElement)
|
|
||||||
log("視頻缩略图", msgElement.videoElement.thumbPath.get(0));
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const picPath = msgElement.picElement?.sourcePath
|
const picPath = msgElement.picElement?.sourcePath
|
||||||
|
const picThumbPath = [...msgElement.picElement?.thumbPath.values()]
|
||||||
const pttPath = msgElement.pttElement?.filePath
|
const pttPath = msgElement.pttElement?.filePath
|
||||||
const filePath = msgElement.fileElement?.filePath
|
const filePath = msgElement.fileElement?.filePath
|
||||||
const videoPath = msgElement.videoElement?.filePath
|
const videoPath = msgElement.videoElement?.filePath
|
||||||
const pathList = [picPath, pttPath, filePath, videoPath]
|
const videoThumbPath: string[] = [...msgElement.videoElement?.thumbPath.values()]
|
||||||
|
const pathList = [picPath, ...picThumbPath, pttPath, filePath, videoPath, ...videoThumbPath]
|
||||||
if (msgElement.picElement) {
|
if (msgElement.picElement) {
|
||||||
pathList.push(...Object.values(msgElement.picElement.thumbPath))
|
pathList.push(...Object.values(msgElement.picElement.thumbPath))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user