From 48bca424ed900bdf7e2e50fef2bde589f5e02b31 Mon Sep 17 00:00:00 2001 From: Clansty Date: Sun, 24 Mar 2024 00:24:57 +0800 Subject: [PATCH] deps: bump icqq --- .npmrc | 1 + main/package.json | 2 +- main/src/api/richHeader.ts | 2 +- main/src/client/OicqClient.ts | 10 ++-- main/src/controllers/ConfigController.ts | 2 +- .../controllers/DeleteMessageController.ts | 2 +- main/src/controllers/ForwardController.ts | 2 +- main/src/controllers/HugController.ts | 2 +- .../controllers/InChatCommandsController.ts | 2 +- .../controllers/MiraiSkipFilterController.ts | 2 +- main/src/controllers/QuotLyController.ts | 2 +- main/src/controllers/RequestController.ts | 2 +- main/src/helpers/RecoverMessageHelper.ts | 2 +- main/src/helpers/forwardHelper.ts | 2 +- main/src/helpers/setupHelper.ts | 2 +- main/src/models/ForwardPairs.ts | 2 +- main/src/models/Pair.ts | 2 +- main/src/services/ConfigService.ts | 2 +- main/src/services/DeleteMessageService.ts | 2 +- main/src/services/ForwardService.ts | 4 +- main/src/services/InChatCommandsService.ts | 2 +- main/src/services/SetupService.ts | 2 +- main/src/types/definitions.d.ts | 2 +- main/src/utils/getAboutText.ts | 2 +- main/src/utils/urls.ts | 2 +- package.json | 2 +- pnpm-lock.yaml | 56 ++++++++++--------- 27 files changed, 61 insertions(+), 56 deletions(-) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..ba70ebf --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@icqqjs:registry=https://npm.pkg.github.com diff --git a/main/package.json b/main/package.json index 15b83c1..31774fc 100644 --- a/main/package.json +++ b/main/package.json @@ -26,6 +26,7 @@ "dependencies": { "@fastify/http-proxy": "^9.4.0", "@fastify/static": "^7.0.1", + "@icqqjs/icqq": "^1.1.2", "@prisma/client": "5.9.1", "axios": "^1.6.8", "baidu-aip-sdk": "^4.16.15", @@ -39,7 +40,6 @@ "fastify": "^4.26.2", "file-type": "^19.0.0", "fluent-ffmpeg": "^2.1.2", - "icqq": "^0.6.10", "image-size": "^1.1.1", "lodash": "^4.17.21", "log4js": "^6.9.1", diff --git a/main/src/api/richHeader.ts b/main/src/api/richHeader.ts index 67b06b2..bdfacd6 100644 --- a/main/src/api/richHeader.ts +++ b/main/src/api/richHeader.ts @@ -2,7 +2,7 @@ import { FastifyPluginCallback } from 'fastify'; import { Pair } from '../models/Pair'; import ejs from 'ejs'; import fs from 'fs'; -import { Group } from 'icqq'; +import { Group } from '@icqqjs/icqq'; import { format } from 'date-and-time'; const template = ejs.compile(fs.readFileSync('./assets/richHeader.ejs', 'utf-8')); diff --git a/main/src/client/OicqClient.ts b/main/src/client/OicqClient.ts index f0b94a3..7d1f552 100644 --- a/main/src/client/OicqClient.ts +++ b/main/src/client/OicqClient.ts @@ -7,17 +7,17 @@ import { LogLevel, Platform, PrivateMessage, PrivateMessageEvent, -} from 'icqq'; +} from '@icqqjs/icqq'; import random from '../utils/random'; import fs from 'fs'; import fsP from 'fs/promises'; -import { Config } from 'icqq/lib/client'; +import { Config } from '@icqqjs/icqq/lib/client'; import dataPath from '../helpers/dataPath'; import os from 'os'; -import { Converter, Image, rand2uuid } from 'icqq/lib/message'; +import { Converter, Image, rand2uuid } from '@icqqjs/icqq/lib/message'; import { randomBytes } from 'crypto'; -import { gzip, timestamp } from 'icqq/lib/common'; -import { pb } from 'icqq/lib/core'; +import { gzip, timestamp } from '@icqqjs/icqq/lib/common'; +import { pb } from '@icqqjs/icqq/lib/core'; import env from '../models/env'; const LOG_LEVEL: LogLevel = env.OICQ_LOG_LEVEL; diff --git a/main/src/controllers/ConfigController.ts b/main/src/controllers/ConfigController.ts index c94e778..f47f6f8 100644 --- a/main/src/controllers/ConfigController.ts +++ b/main/src/controllers/ConfigController.ts @@ -9,7 +9,7 @@ import { MemberDecreaseEvent, MemberIncreaseEvent, PrivateMessageEvent, -} from 'icqq'; +} from '@icqqjs/icqq'; import Instance from '../models/Instance'; import { getLogger, Logger } from 'log4js'; import { editFlags } from '../utils/flagControl'; diff --git a/main/src/controllers/DeleteMessageController.ts b/main/src/controllers/DeleteMessageController.ts index e5e3d7a..4869f43 100644 --- a/main/src/controllers/DeleteMessageController.ts +++ b/main/src/controllers/DeleteMessageController.ts @@ -2,7 +2,7 @@ import DeleteMessageService from '../services/DeleteMessageService'; import Telegram from '../client/Telegram'; import OicqClient from '../client/OicqClient'; import { Api } from 'telegram'; -import { FriendRecallEvent, GroupRecallEvent } from 'icqq'; +import { FriendRecallEvent, GroupRecallEvent } from '@icqqjs/icqq'; import { DeletedMessageEvent } from 'telegram/events/DeletedMessage'; import Instance from '../models/Instance'; diff --git a/main/src/controllers/ForwardController.ts b/main/src/controllers/ForwardController.ts index eefda63..4d11458 100644 --- a/main/src/controllers/ForwardController.ts +++ b/main/src/controllers/ForwardController.ts @@ -8,7 +8,7 @@ import { GroupPokeEvent, MemberIncreaseEvent, PrivateMessageEvent, -} from 'icqq'; +} from '@icqqjs/icqq'; import db from '../models/db'; import { Api } from 'telegram'; import { getLogger, Logger } from 'log4js'; diff --git a/main/src/controllers/HugController.ts b/main/src/controllers/HugController.ts index 7e50899..03bba1f 100644 --- a/main/src/controllers/HugController.ts +++ b/main/src/controllers/HugController.ts @@ -1,7 +1,7 @@ import Instance from '../models/Instance'; import Telegram from '../client/Telegram'; import OicqClient from '../client/OicqClient'; -import { AtElem, Group, GroupMessageEvent, PrivateMessageEvent, Sendable } from 'icqq'; +import { AtElem, Group, GroupMessageEvent, PrivateMessageEvent, Sendable } from '@icqqjs/icqq'; import { Pair } from '../models/Pair'; import { Api } from 'telegram'; import db from '../models/db'; diff --git a/main/src/controllers/InChatCommandsController.ts b/main/src/controllers/InChatCommandsController.ts index a092e6e..b48f136 100644 --- a/main/src/controllers/InChatCommandsController.ts +++ b/main/src/controllers/InChatCommandsController.ts @@ -4,7 +4,7 @@ import Instance from '../models/Instance'; import Telegram from '../client/Telegram'; import OicqClient from '../client/OicqClient'; import { Api } from 'telegram'; -import { Group } from 'icqq'; +import { Group } from '@icqqjs/icqq'; import RecoverMessageHelper from '../helpers/RecoverMessageHelper'; import flags from '../constants/flags'; import { editFlags } from '../utils/flagControl'; diff --git a/main/src/controllers/MiraiSkipFilterController.ts b/main/src/controllers/MiraiSkipFilterController.ts index d45753e..8ba356b 100644 --- a/main/src/controllers/MiraiSkipFilterController.ts +++ b/main/src/controllers/MiraiSkipFilterController.ts @@ -1,7 +1,7 @@ import Instance from '../models/Instance'; import Telegram from '../client/Telegram'; import OicqClient from '../client/OicqClient'; -import { GroupMessageEvent, MiraiElem, PrivateMessageEvent } from 'icqq'; +import { GroupMessageEvent, MiraiElem, PrivateMessageEvent } from '@icqqjs/icqq'; export default class { constructor(private readonly instance: Instance, diff --git a/main/src/controllers/QuotLyController.ts b/main/src/controllers/QuotLyController.ts index 99efbe6..dcb03bf 100644 --- a/main/src/controllers/QuotLyController.ts +++ b/main/src/controllers/QuotLyController.ts @@ -2,7 +2,7 @@ import Instance from '../models/Instance'; import Telegram from '../client/Telegram'; import OicqClient from '../client/OicqClient'; import { getLogger, Logger } from 'log4js'; -import { Group, GroupMessageEvent, PrivateMessageEvent } from 'icqq'; +import { Group, GroupMessageEvent, PrivateMessageEvent } from '@icqqjs/icqq'; import { Api } from 'telegram'; import quotly from 'quote-api/methods/generate.js'; import { CustomFile } from 'telegram/client/uploads'; diff --git a/main/src/controllers/RequestController.ts b/main/src/controllers/RequestController.ts index e01c121..3e4c961 100644 --- a/main/src/controllers/RequestController.ts +++ b/main/src/controllers/RequestController.ts @@ -2,7 +2,7 @@ import { getLogger, Logger } from 'log4js'; import Instance from '../models/Instance'; import Telegram from '../client/Telegram'; import OicqClient from '../client/OicqClient'; -import { FriendRequestEvent, GroupInviteEvent } from 'icqq'; +import { FriendRequestEvent, GroupInviteEvent } from '@icqqjs/icqq'; import { getAvatar } from '../utils/urls'; import { CustomFile } from 'telegram/client/uploads'; import { Button } from 'telegram/tl/custom/button'; diff --git a/main/src/helpers/RecoverMessageHelper.ts b/main/src/helpers/RecoverMessageHelper.ts index b72ab85..a36b640 100644 --- a/main/src/helpers/RecoverMessageHelper.ts +++ b/main/src/helpers/RecoverMessageHelper.ts @@ -3,7 +3,7 @@ import Telegram from '../client/Telegram'; import OicqClient from '../client/OicqClient'; import { Pair } from '../models/Pair'; import { Api } from 'telegram'; -import { GroupMessage, PrivateMessage } from 'icqq'; +import { GroupMessage, PrivateMessage } from '@icqqjs/icqq'; import db from '../models/db'; import { format } from 'date-and-time'; import lottie from '../constants/lottie'; diff --git a/main/src/helpers/forwardHelper.ts b/main/src/helpers/forwardHelper.ts index 4c925f8..4dc8e8a 100644 --- a/main/src/helpers/forwardHelper.ts +++ b/main/src/helpers/forwardHelper.ts @@ -3,7 +3,7 @@ import { CustomFile } from 'telegram/client/uploads'; import { base64decode } from 'nodejs-base64'; import { getLogger } from 'log4js'; import { Entity } from 'telegram/define'; -import { ForwardMessage } from 'icqq'; +import { ForwardMessage } from '@icqqjs/icqq'; import { Api } from 'telegram'; import { imageSize } from 'image-size'; import env from '../models/env'; diff --git a/main/src/helpers/setupHelper.ts b/main/src/helpers/setupHelper.ts index 801b4db..ed9e4a0 100644 --- a/main/src/helpers/setupHelper.ts +++ b/main/src/helpers/setupHelper.ts @@ -1,4 +1,4 @@ -import { Platform } from 'icqq'; +import { Platform } from '@icqqjs/icqq'; export default { convertTextToPlatform(text: string): Platform { diff --git a/main/src/models/ForwardPairs.ts b/main/src/models/ForwardPairs.ts index 39a0731..abcb334 100644 --- a/main/src/models/ForwardPairs.ts +++ b/main/src/models/ForwardPairs.ts @@ -1,4 +1,4 @@ -import { Friend, Group } from 'icqq'; +import { Friend, Group } from '@icqqjs/icqq'; import TelegramChat from '../client/TelegramChat'; import OicqClient from '../client/OicqClient'; import Telegram from '../client/Telegram'; diff --git a/main/src/models/Pair.ts b/main/src/models/Pair.ts index 7a7cc19..0fdf6d8 100644 --- a/main/src/models/Pair.ts +++ b/main/src/models/Pair.ts @@ -1,5 +1,5 @@ import { getLogger } from 'log4js'; -import { Friend, Group } from 'icqq'; +import { Friend, Group } from '@icqqjs/icqq'; import TelegramChat from '../client/TelegramChat'; import getAboutText from '../utils/getAboutText'; import { md5 } from '../utils/hashing'; diff --git a/main/src/services/ConfigService.ts b/main/src/services/ConfigService.ts index 3371fbb..9c182a5 100644 --- a/main/src/services/ConfigService.ts +++ b/main/src/services/ConfigService.ts @@ -1,5 +1,5 @@ import Telegram from '../client/Telegram'; -import { Friend, FriendInfo, Group, GroupInfo } from 'icqq'; +import { Friend, FriendInfo, Group, GroupInfo } from '@icqqjs/icqq'; import { Button } from 'telegram/tl/custom/button'; import { getLogger, Logger } from 'log4js'; import { getAvatar } from '../utils/urls'; diff --git a/main/src/services/DeleteMessageService.ts b/main/src/services/DeleteMessageService.ts index 4d31793..fa79cb7 100644 --- a/main/src/services/DeleteMessageService.ts +++ b/main/src/services/DeleteMessageService.ts @@ -2,7 +2,7 @@ import Telegram from '../client/Telegram'; import { getLogger, Logger } from 'log4js'; import { Api } from 'telegram'; import db from '../models/db'; -import { Friend, FriendRecallEvent, Group, GroupRecallEvent } from 'icqq'; +import { Friend, FriendRecallEvent, Group, GroupRecallEvent } from '@icqqjs/icqq'; import Instance from '../models/Instance'; import { Pair } from '../models/Pair'; import { consumer } from '../utils/highLevelFunces'; diff --git a/main/src/services/ForwardService.ts b/main/src/services/ForwardService.ts index 8e72ac7..3b42a73 100644 --- a/main/src/services/ForwardService.ts +++ b/main/src/services/ForwardService.ts @@ -10,7 +10,7 @@ import { Quotable, segment, Sendable, -} from 'icqq'; +} from '@icqqjs/icqq'; import { fetchFile, getBigFaceUrl, getImageUrlByMd5 } from '../utils/urls'; import { ButtonLike, FileLike } from 'telegram/define'; import { getLogger, Logger } from 'log4js'; @@ -38,7 +38,7 @@ import { QQMessageSent } from '../types/definitions'; import ZincSearch from 'zincsearch-node'; import { speech as AipSpeechClient } from 'baidu-aip-sdk'; import random from '../utils/random'; -import { escapeXml } from 'icqq/lib/common'; +import { escapeXml } from '@icqqjs/icqq/lib/common'; import Docker from 'dockerode'; import ReplyKeyboardHide = Api.ReplyKeyboardHide; import env from '../models/env'; diff --git a/main/src/services/InChatCommandsService.ts b/main/src/services/InChatCommandsService.ts index fcd4b02..422136c 100644 --- a/main/src/services/InChatCommandsService.ts +++ b/main/src/services/InChatCommandsService.ts @@ -8,7 +8,7 @@ import { Pair } from '../models/Pair'; import { CustomFile } from 'telegram/client/uploads'; import { getAvatar } from '../utils/urls'; import db from '../models/db'; -import { Friend, Group } from 'icqq'; +import { Friend, Group } from '@icqqjs/icqq'; import { format } from 'date-and-time'; import ZincSearch from 'zincsearch-node'; import env from '../models/env'; diff --git a/main/src/services/SetupService.ts b/main/src/services/SetupService.ts index 0213180..cca8fe9 100644 --- a/main/src/services/SetupService.ts +++ b/main/src/services/SetupService.ts @@ -1,7 +1,7 @@ import Telegram from '../client/Telegram'; import { getLogger, Logger } from 'log4js'; import { BigInteger } from 'big-integer'; -import { Platform } from 'icqq'; +import { Platform } from '@icqqjs/icqq'; import { MarkupLike } from 'telegram/define'; import OicqClient from '../client/OicqClient'; import { Button } from 'telegram/tl/custom/button'; diff --git a/main/src/types/definitions.d.ts b/main/src/types/definitions.d.ts index 894e6f5..d6c5ed9 100644 --- a/main/src/types/definitions.d.ts +++ b/main/src/types/definitions.d.ts @@ -1,4 +1,4 @@ -import { MessageRet } from 'icqq'; +import { MessageRet } from '@icqqjs/icqq'; export type WorkMode = 'group' | 'personal'; export type QQMessageSent = MessageRet & { senderId: number, brief: string }; diff --git a/main/src/utils/getAboutText.ts b/main/src/utils/getAboutText.ts index 085aaad..bcb5524 100644 --- a/main/src/utils/getAboutText.ts +++ b/main/src/utils/getAboutText.ts @@ -1,4 +1,4 @@ -import { Friend, Group } from 'icqq'; +import { Friend, Group } from '@icqqjs/icqq'; export default async function getAboutText(entity: Friend | Group, html: boolean) { let text: string; diff --git a/main/src/utils/urls.ts b/main/src/utils/urls.ts index 5fcc477..1dc37cf 100644 --- a/main/src/utils/urls.ts +++ b/main/src/utils/urls.ts @@ -1,5 +1,5 @@ import axios from 'axios'; -import { Friend, Group } from 'icqq'; +import { Friend, Group } from '@icqqjs/icqq'; export function getAvatarUrl(room: number | bigint | Friend | Group): string { if (!room) return ''; diff --git a/package.json b/package.json index 45b3895..0a1c52c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "pnpm": { "patchedDependencies": { - "icqq@0.6.10": "patches/icqq@0.6.10.patch" + "@icqqjs/icqq@1.1.2": "patches/icqq@0.6.10.patch" } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0676529..a5cfcce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false patchedDependencies: - icqq@0.6.10: + '@icqqjs/icqq@1.1.2': hash: lvxibeykgrherv3ldsrdfzrnaq path: patches/icqq@0.6.10.patch @@ -25,6 +25,9 @@ importers: '@fastify/static': specifier: ^7.0.1 version: 7.0.1 + '@icqqjs/icqq': + specifier: ^1.1.2 + version: 1.1.2(patch_hash=lvxibeykgrherv3ldsrdfzrnaq) '@prisma/client': specifier: 5.9.1 version: 5.9.1(prisma@5.9.1) @@ -64,9 +67,6 @@ importers: fluent-ffmpeg: specifier: ^2.1.2 version: 2.1.2 - icqq: - specifier: ^0.6.10 - version: 0.6.10(patch_hash=lvxibeykgrherv3ldsrdfzrnaq) image-size: specifier: ^1.1.1 version: 1.1.1 @@ -96,7 +96,7 @@ importers: version: 0.2.2 telegram: specifier: https://github.com/clansty/gramjs/releases/download/2.19.10%2Brevert_media/telegram-2.19.10.tgz - version: '@github.com/clansty/gramjs/releases/download/2.19.10%2525252Brevert_media/telegram-2.19.10.tgz' + version: '@github.com/clansty/gramjs/releases/download/2.19.10%2525252525252Brevert_media/telegram-2.19.10.tgz' tmp-promise: specifier: ^3.0.3 version: 3.0.3 @@ -786,6 +786,23 @@ packages: glob: 10.3.10 dev: false + /@icqqjs/icqq@1.1.2(patch_hash=lvxibeykgrherv3ldsrdfzrnaq): + resolution: {integrity: sha512-5hvFVYlV6qp7leC60c+HGfgjhK5udSIN92mEUfzbWKK+Xx8Z2ruMEAzIzfOcFkBugyzmjX5vxhymDH3diQm0pA==, tarball: https://npm.pkg.github.com/download/@icqqjs/icqq/1.1.2/aa71ad688f4e2ca32f883cef340f2387968d12c6} + engines: {node: '>= v14'} + dependencies: + axios: 1.6.8 + log4js: 6.9.1 + long: 5.2.3 + pngjs: 7.0.0 + probe-image-size: 7.2.3 + silk-wasm: 3.2.3 + triptrap: 0.0.17 + transitivePeerDependencies: + - debug + - supports-color + dev: false + patched: true + /@img/sharp-darwin-arm64@0.33.2: resolution: {integrity: sha512-itHBs1rPmsmGF9p4qRe++CzCgd+kFYktnsoR1sbIAfsRMrJZau0Tt1AH9KVnufc2/tU02Gf6Ibujx+15qRE03w==} engines: {glibc: '>=2.26', node: ^18.17.0 || ^20.3.0 || >=21.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0', yarn: '>=3.2.0'} @@ -3352,24 +3369,6 @@ packages: safer-buffer: 2.1.2 dev: false - /icqq@0.6.10(patch_hash=lvxibeykgrherv3ldsrdfzrnaq): - resolution: {integrity: sha512-3LfK9r7WUnuVFyrVDH92DgFhsqNK/Itp91XJAD+DZHKEQK6UlR7F+xoEcpUIEfi9dy8GWqOgr5ZTunjd5GhMdA==} - engines: {node: '>= v14'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - dependencies: - axios: 1.6.8 - log4js: 6.9.1 - long: 4.0.0 - pngjs: 6.0.0 - probe-image-size: 7.2.3 - silk-wasm: 3.2.3 - triptrap: 0.0.17 - transitivePeerDependencies: - - debug - - supports-color - dev: false - patched: true - /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} dev: false @@ -3798,8 +3797,8 @@ packages: - supports-color dev: false - /long@4.0.0: - resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} + /long@5.2.3: + resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==} dev: false /lottie-node@2.0.0(canvas@2.11.2)(jsdom@16.7.0)(lottie-web@5.12.2): @@ -4307,6 +4306,11 @@ packages: engines: {node: '>=12.13.0'} dev: false + /pngjs@7.0.0: + resolution: {integrity: sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==} + engines: {node: '>=14.19.0'} + dev: false + /postcss@8.4.35: resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==} engines: {node: ^10 || ^12 || >=14} @@ -5669,7 +5673,7 @@ packages: - utf-8-validate dev: false - '@github.com/clansty/gramjs/releases/download/2.19.10%2525252Brevert_media/telegram-2.19.10.tgz': + '@github.com/clansty/gramjs/releases/download/2.19.10%2525252525252Brevert_media/telegram-2.19.10.tgz': resolution: {tarball: https://github.com/clansty/gramjs/releases/download/2.19.10%2Brevert_media/telegram-2.19.10.tgz} name: telegram version: 2.19.10