diff --git a/package.json b/package.json index ff8e6bc7..e46b74e3 100644 --- a/package.json +++ b/package.json @@ -13,15 +13,15 @@ "assets" ], "devDependencies": { - "@types/cli-progress": "^3.11.0", + "@types/cli-progress": "^3.11.5", "@types/date-and-time": "^0.13.0", - "@types/fluent-ffmpeg": "^2.1.20", - "@types/lodash": "^4", + "@types/fluent-ffmpeg": "^2.1.24", + "@types/lodash": "^4.14.201", "@types/node": "^18.6.3", - "@types/prompts": "^2.0.14", + "@types/prompts": "^2.4.8", "@types/sharp": "^0.31.1", "ts-node": "^10.9.1", - "typescript": "^4.7.4" + "typescript": "^5.2.2" }, "dependencies": { "@prisma/client": "5.5.2", @@ -34,7 +34,7 @@ "eviltransform": "^0.2.2", "file-type": "^17.1.4", "fluent-ffmpeg": "^2.1.2", - "icqq": "^0.6.1", + "icqq": "^0.6.2", "image-size": "^1.0.2", "lodash": "^4.17.21", "log4js": "^6.6.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42a54ec9..e91a2f44 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ dependencies: specifier: ^2.1.2 version: 2.1.2 icqq: - specifier: ^0.6.1 - version: 0.6.1 + specifier: ^0.6.2 + version: 0.6.2 image-size: specifier: ^1.0.2 version: 1.0.2 @@ -80,32 +80,32 @@ dependencies: devDependencies: '@types/cli-progress': - specifier: ^3.11.0 - version: 3.11.4 + specifier: ^3.11.5 + version: 3.11.5 '@types/date-and-time': specifier: ^0.13.0 version: 0.13.0 '@types/fluent-ffmpeg': - specifier: ^2.1.20 - version: 2.1.23 + specifier: ^2.1.24 + version: 2.1.24 '@types/lodash': - specifier: ^4 - version: 4.14.200 + specifier: ^4.14.201 + version: 4.14.201 '@types/node': specifier: ^18.6.3 version: 18.18.8 '@types/prompts': - specifier: ^2.0.14 - version: 2.4.7 + specifier: ^2.4.8 + version: 2.4.8 '@types/sharp': specifier: ^0.31.1 version: 0.31.1 ts-node: specifier: ^10.9.1 - version: 10.9.1(@types/node@18.18.8)(typescript@4.9.5) + version: 10.9.1(@types/node@18.18.8)(typescript@5.2.2) typescript: - specifier: ^4.7.4 - version: 4.9.5 + specifier: ^5.2.2 + version: 5.2.2 packages: @@ -589,8 +589,8 @@ packages: resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} dev: true - /@types/cli-progress@3.11.4: - resolution: {integrity: sha512-yufTxeeNCZuEIxx2uebK8lpSAsJM4lvzakm/VxzYhDtqhXCzwH9jpn7nPCxzrROuEbLATqhFq4MIPoG0tlrsvw==} + /@types/cli-progress@3.11.5: + resolution: {integrity: sha512-D4PbNRbviKyppS5ivBGyFO29POlySLmA2HyUFE4p5QGazAMM3CwkKWcvTl8gvElSuxRh6FPKL8XmidX873ou4g==} dependencies: '@types/node': 18.18.8 dev: true @@ -599,14 +599,14 @@ packages: resolution: {integrity: sha512-kHEncapIgrqaY8r2tyb19EvdKyhNjwheLl5cYTorsWJtURoI+oGm5ehW8CLAaq4dvu8x9z56FcXqAT4Mm5Nvzw==} dev: true - /@types/fluent-ffmpeg@2.1.23: - resolution: {integrity: sha512-ZEogBz8YpWflRox2uzGUNOYolQPUDGMNUFhf6fY/cW+6i00oeSTD0tYf4az6/162jv0YsRYi6uxigssnag7E7A==} + /@types/fluent-ffmpeg@2.1.24: + resolution: {integrity: sha512-g5oQO8Jgi2kFS3tTub7wLvfLztr1s8tdXmRd8PiL/hLMLzTIAyMR2sANkTggM/rdEDAg3d63nYRRVepwBiCw5A==} dependencies: '@types/node': 18.18.8 dev: true - /@types/lodash@4.14.200: - resolution: {integrity: sha512-YI/M/4HRImtNf3pJgbF+W6FrXovqj+T+/HpENLTooK9PnkacBsDpeP3IpHab40CClUfhNmdM2WTNP2sa2dni5Q==} + /@types/lodash@4.14.201: + resolution: {integrity: sha512-y9euML0cim1JrykNxADLfaG0FgD1g/yTHwUs/Jg9ZIU7WKj2/4IW9Lbb1WZbvck78W/lfGXFfe+u2EGfIJXdLQ==} dev: true /@types/node@16.9.1: @@ -619,8 +619,8 @@ packages: undici-types: 5.26.5 dev: true - /@types/prompts@2.4.7: - resolution: {integrity: sha512-5zTamE+QQM4nR6Ab3yHK+ovWuhLJXaa2ZLt3mT1en8U3ubWtjVT1vXDaVFC2+cL89uVn7Y+gIq5B3IcVvBl5xQ==} + /@types/prompts@2.4.8: + resolution: {integrity: sha512-fPOEzviubkEVCiLduO45h+zFHB0RZX8tFt3C783sO5cT7fUXf3EEECpD26djtYdh4Isa9Z9tasMQuZnYPtvYzw==} dependencies: '@types/node': 18.18.8 kleur: 3.0.3 @@ -1754,8 +1754,8 @@ packages: safer-buffer: 2.1.2 dev: false - /icqq@0.6.1: - resolution: {integrity: sha512-ljBHn2GpJifeKNhVDrB8jv+HyTpra3lqe93FFUDMQSnECoyTVzufVEm+iIljEoKHnTHXlf7SryfeLTXpgjYjTw==} + /icqq@0.6.2: + resolution: {integrity: sha512-fwB/tXWKu9m/p986hiK4cRg5KSRGY20AEB8KRWNWnlmDADIkEwZdHO9iOe5cIcry0mOpgbWxLdr6RlhLMwd+Lw==} engines: {node: '>= v14'} dependencies: axios: 1.6.0 @@ -3216,7 +3216,7 @@ packages: engines: {node: '>=14.0.0'} dev: false - /ts-node@10.9.1(@types/node@18.18.8)(typescript@4.9.5): + /ts-node@10.9.1(@types/node@18.18.8)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -3242,7 +3242,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.9.5 + typescript: 5.2.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -3296,6 +3296,13 @@ packages: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} hasBin: true + dev: false + + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + engines: {node: '>=14.17'} + hasBin: true + dev: true /underscore@1.13.6: resolution: {integrity: sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==} diff --git a/src/controllers/ForwardController.ts b/src/controllers/ForwardController.ts index 28afee3b..c06637dc 100644 --- a/src/controllers/ForwardController.ts +++ b/src/controllers/ForwardController.ts @@ -47,6 +47,20 @@ export default class ForwardController { if (!pair) return; if (!pair.enable) return; if (pair.disableQ2TG) return; + // 如果是多张图片的话,是一整条消息,只过一次,所以不受这个判断影响 + let existed = event.message_type === 'private' && await db.message.findFirst({ + where: { + qqRoomId: pair.qqRoomId, + qqSenderId: event.sender.user_id, + seq: event.seq, + rand: event.rand, + pktnum: event.pktnum, + time: event.time, + instanceId: this.instance.id, + }, + }); + if (existed) return; + // 开始转发过程 let tgMessages: Api.Message | Api.Message[] = await this.forwardService.forwardFromQq(event, pair); if (!tgMessages) return; if (!Array.isArray(tgMessages)) { @@ -57,7 +71,7 @@ export default class ForwardController { await db.message.create({ data: { qqRoomId: pair.qqRoomId, - qqSenderId: event.user_id, + qqSenderId: event.sender.user_id, time: event.time, brief: event.raw_message, seq: event.seq,