deps: bump icqq

This commit is contained in:
Clansty 2024-03-29 20:54:45 +08:00
parent 1e330bd6d2
commit e8949bd373
4 changed files with 117 additions and 15 deletions

View File

@ -28,7 +28,7 @@
"dependencies": { "dependencies": {
"@fastify/http-proxy": "^9.4.0", "@fastify/http-proxy": "^9.4.0",
"@fastify/static": "^7.0.1", "@fastify/static": "^7.0.1",
"@icqqjs/icqq": "1.0.2", "@icqqjs/icqq": "1.1.3",
"@prisma/client": "5.9.1", "@prisma/client": "5.9.1",
"axios": "^1.6.8", "axios": "^1.6.8",
"baidu-aip-sdk": "^4.16.15", "baidu-aip-sdk": "^4.16.15",

View File

@ -9,7 +9,7 @@
}, },
"pnpm": { "pnpm": {
"patchedDependencies": { "patchedDependencies": {
"@icqqjs/icqq@1.0.2": "patches/@icqqjs__icqq@1.0.2.patch" "@icqqjs/icqq@1.1.3": "patches/@icqqjs__icqq@1.1.3.patch"
} }
} }
} }

View File

@ -0,0 +1,97 @@
diff --git a/lib/message/converter.d.ts b/lib/message/converter.d.ts
index 599b17b7cf4bb2a556f4dde36ef0597b3778357f..3c360ac7e80a00c9f43de71c582a45f8bfc7738d 100644
--- a/lib/message/converter.d.ts
+++ b/lib/message/converter.d.ts
@@ -55,6 +55,7 @@ export declare class Converter {
private mirai;
private file;
private reply;
+ private longmsg;
/** 转换为分片消息 */
toFragments(): Uint8Array[];
private _divideText;
diff --git a/lib/message/converter.js b/lib/message/converter.js
index fea96dfe79cc6a30e9d366a28534ba9dfba47850..d600bc7e4c1b344b714ad9733c5d76bff4c25b1d 100644
--- a/lib/message/converter.js
+++ b/lib/message/converter.js
@@ -93,7 +93,7 @@ class Converter {
return;
}
if (qq === "all") {
- var q = 0, flag = 1, display = "全体成员";
+ var q = 0, flag = 1, display = text || "全体成员";
}
else {
var q = Number(qq), flag = 0, display = text || String(qq);
@@ -103,7 +103,6 @@ class Converter {
display = member?.card || member?.nickname || display;
}
}
- display = "@" + display;
if (dummy)
return this._text(display);
const buf = Buffer.allocUnsafe(6);
@@ -451,6 +450,15 @@ class Converter {
});
this.brief += data;
}
+ longmsg(elem) {
+ const { resId } = elem;
+ this.elems.push({
+ 37: {
+ 6: 1,
+ 7: resId
+ }
+ });
+ }
file(elem) {
throw new Error("暂不支持发送或转发file元素请调用文件相关API完成该操作");
}
diff --git a/lib/message/elements.d.ts b/lib/message/elements.d.ts
index 3bfa7465fe2fa1a2f1aeafe054cb590bf0ed68f0..22976e83d0b747fbceb6e8b8f09ece1eefe808aa 100644
--- a/lib/message/elements.d.ts
+++ b/lib/message/elements.d.ts
@@ -184,6 +184,10 @@ export interface ButtonElem {
}[];
};
}
+export interface LongMsgElem {
+ type: "longmsg";
+ resId: string;
+}
export interface Button {
/** 按钮ID在一个keyboard消息内设置唯一 */
id?: string;
@@ -290,7 +294,7 @@ export interface ForwardNode extends Forwardable {
export type ChainElem = TextElem | FaceElem | BfaceElem | MfaceElem | ImageElem | AtElem | MiraiElem | ReplyElem | ForwardNode | QuoteElem | MarkdownElem | ButtonElem;
export declare const ChainElemTypes: ChainElem["type"][];
/** 注意:只有`ChainElem`中的元素可以组合发送,其他元素只能单独发送 */
-export type MessageElem = TextElem | FaceElem | BfaceElem | MfaceElem | ImageElem | AtElem | MiraiElem | ReplyElem | FlashElem | PttElem | VideoElem | JsonElem | XmlElem | PokeElem | LocationElem | ShareElem | MusicElem | FileElem | ForwardNode | QuoteElem | MarkdownElem | ButtonElem;
+export type MessageElem = TextElem | FaceElem | BfaceElem | MfaceElem | ImageElem | AtElem | MiraiElem | ReplyElem | FlashElem | PttElem | VideoElem | JsonElem | XmlElem | PokeElem | LocationElem | ShareElem | MusicElem | FileElem | ForwardNode | QuoteElem | MarkdownElem | ButtonElem | LongMsgElem;
/** 可通过`sendMsg`发送的类型集合 (字符串、元素对象,或它们的数组) */
export type Sendable = string | MessageElem | (string | MessageElem)[];
/** 用于构造消息元素 */
@@ -323,6 +327,7 @@ export declare const segment: {
xml(data: string, id?: number): XmlElem;
markdown(content: string): MarkdownElem;
button(content: ButtonElem["content"]): ButtonElem;
+ longmsg(resId: string): LongMsgElem;
/** 一种特殊消息(官方客户端无法解析) */
mirai(data: string): MiraiElem;
/** 音乐 */
diff --git a/lib/message/elements.js b/lib/message/elements.js
index de3a1d116c794ae2ee9e18836d6669a4d89d59d0..9c6c5c1fc5949eb49636d539aed4ed140bb3ec0a 100644
--- a/lib/message/elements.js
+++ b/lib/message/elements.js
@@ -99,6 +99,11 @@ exports.segment = {
type: "button", content
};
},
+ longmsg(resId) {
+ return {
+ type: "longmsg", resId
+ };
+ },
/** 一种特殊消息(官方客户端无法解析) */
mirai(data) {
return {

View File

@ -5,9 +5,9 @@ settings:
excludeLinksFromLockfile: false excludeLinksFromLockfile: false
patchedDependencies: patchedDependencies:
'@icqqjs/icqq@1.0.2': '@icqqjs/icqq@1.1.3':
hash: wxe3a6ue6lwbvkaznekqvakwcq hash: sdjingcrnbi2vxtzt4kdqlffba
path: patches/@icqqjs__icqq@1.0.2.patch path: patches/@icqqjs__icqq@1.1.3.patch
importers: importers:
@ -26,8 +26,8 @@ importers:
specifier: ^7.0.1 specifier: ^7.0.1
version: 7.0.1 version: 7.0.1
'@icqqjs/icqq': '@icqqjs/icqq':
specifier: 1.0.2 specifier: 1.1.3
version: 1.0.2(patch_hash=wxe3a6ue6lwbvkaznekqvakwcq) version: 1.1.3(patch_hash=sdjingcrnbi2vxtzt4kdqlffba)
'@prisma/client': '@prisma/client':
specifier: 5.9.1 specifier: 5.9.1
version: 5.9.1(prisma@5.9.1) version: 5.9.1(prisma@5.9.1)
@ -102,7 +102,7 @@ importers:
version: 0.2.2 version: 0.2.2
telegram: telegram:
specifier: https://github.com/clansty/gramjs/releases/download/2.19.10%2Brevert_media/telegram-2.19.10.tgz 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%252525252525252525252525252Brevert_media/telegram-2.19.10.tgz' version: '@github.com/clansty/gramjs/releases/download/2.19.10%2525252525252525252525252525252Brevert_media/telegram-2.19.10.tgz'
tmp-promise: tmp-promise:
specifier: ^3.0.3 specifier: ^3.0.3
version: 3.0.3 version: 3.0.3
@ -798,14 +798,14 @@ packages:
glob: 10.3.10 glob: 10.3.10
dev: false dev: false
/@icqqjs/icqq@1.0.2(patch_hash=wxe3a6ue6lwbvkaznekqvakwcq): /@icqqjs/icqq@1.1.3(patch_hash=sdjingcrnbi2vxtzt4kdqlffba):
resolution: {integrity: sha512-SThmVjnSMpDNjtiCChjOLHsl8hUnWxrdMYLADGL1DxG+dUu5qgVJY7/bVI15MnC16FGz+moksl50A+cMyTSJww==, tarball: https://npm.pkg.github.com/download/@icqqjs/icqq/1.0.2/e21d5e48c12b466908cdf298283b6e4a2d532d2d} resolution: {integrity: sha512-vAXX0VwsT3NuwGmFCiM1cES3+70fNey7GdXJIUSnInH/koHpntMjrm4a96VPx9mBW55FLSLsPsvwQlPSXTNLSA==, tarball: https://npm.pkg.github.com/download/@icqqjs/icqq/1.1.3/28bbae6e42518162eace3ee6f7484dd604c63258}
engines: {node: '>= v14'} engines: {node: '>= v14'}
dependencies: dependencies:
axios: 1.6.8 axios: 1.6.8
log4js: 6.9.1 log4js: 6.9.1
long: 4.0.0 long: 5.2.3
pngjs: 6.0.0 pngjs: 7.0.0
probe-image-size: 7.2.3 probe-image-size: 7.2.3
silk-wasm: 3.2.3 silk-wasm: 3.2.3
triptrap: 0.0.17 triptrap: 0.0.17
@ -3826,8 +3826,8 @@ packages:
- supports-color - supports-color
dev: false dev: false
/long@4.0.0: /long@5.2.3:
resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==}
dev: false dev: false
/lottie-node@2.0.0(canvas@2.11.2)(jsdom@16.7.0)(lottie-web@5.12.2): /lottie-node@2.0.0(canvas@2.11.2)(jsdom@16.7.0)(lottie-web@5.12.2):
@ -4339,6 +4339,11 @@ packages:
engines: {node: '>=12.13.0'} engines: {node: '>=12.13.0'}
dev: false dev: false
/pngjs@7.0.0:
resolution: {integrity: sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==}
engines: {node: '>=14.19.0'}
dev: false
/postcss@8.4.35: /postcss@8.4.35:
resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==} resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==}
engines: {node: ^10 || ^12 || >=14} engines: {node: ^10 || ^12 || >=14}
@ -5701,7 +5706,7 @@ packages:
- utf-8-validate - utf-8-validate
dev: false dev: false
'@github.com/clansty/gramjs/releases/download/2.19.10%252525252525252525252525252Brevert_media/telegram-2.19.10.tgz': '@github.com/clansty/gramjs/releases/download/2.19.10%2525252525252525252525252525252Brevert_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} resolution: {tarball: https://github.com/clansty/gramjs/releases/download/2.19.10%2Brevert_media/telegram-2.19.10.tgz}
name: telegram name: telegram
version: 2.19.10 version: 2.19.10