Q2TG/patches/@icqqjs__icqq@1.2.0.patch

72 lines
2.7 KiB
Diff

diff --git a/lib/common.d.ts b/lib/common.d.ts
index d27f6298a041607768ee58b0d1e75c8bdcedafe1..d4d90b2ef8b63baf1edb84b0ab3118bbf421c515 100644
--- a/lib/common.d.ts
+++ b/lib/common.d.ts
@@ -54,5 +54,11 @@ export interface UserProfile {
signature: string;
/** 自定义的QID */
QID: string;
+ nickname: string;
+ country: string;
+ province: string;
+ city: string;
+ email: string;
+ birthday: [number, number, number];
}
export * from "./core/constants";
diff --git a/lib/internal/internal.js b/lib/internal/internal.js
index ee137c44c92b947dcc7d851bb04f319c9a070f68..4bb7d5d082156f76974269e220051539162792dd 100644
--- a/lib/internal/internal.js
+++ b/lib/internal/internal.js
@@ -86,9 +86,17 @@ async function getUserProfile(uin = this.uin) {
});
// 有需要自己加!
return {
+ nickname: String(profile[20002]),
+ country: String(profile[20003]),
+ province: String(profile[20004]),
+ city: String(profile[20020]),
+ email: String(profile[20011]),
signature: String(profile[102]),
regTimestamp: profile[20026],
- QID: String(profile[27394])
+ QID: String(profile[27394]),
+ birthday: profile[20031].toBuffer().length === 4 ?
+ [profile[20031].toBuffer().slice(0,2).readUInt16BE(), profile[20031].toBuffer().slice(2,3).readUInt8(), profile[20031].toBuffer().slice(3).readUInt8()] :
+ undefined,
};
}
exports.getUserProfile = getUserProfile;
diff --git a/lib/message/converter.js b/lib/message/converter.js
index 27a659a3290fadd990a1a980918515a6ded4978f..e1bbe1470f302c30e7adea92f433a6e3929064e3 100644
--- a/lib/message/converter.js
+++ b/lib/message/converter.js
@@ -111,7 +111,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);
@@ -121,7 +121,6 @@ class Converter {
display = member?.card || member?.nickname || display;
}
}
- display = "@" + display;
if (dummy)
return this._text(display);
const buf = Buffer.allocUnsafe(6);
@@ -535,10 +534,6 @@ class Converter {
quote(source) {
const elems = new Converter(source.message || "", this.ext).elems;
const tmp = this.brief;
- if (!this.ext?.dm) {
- this.at({ type: "at", qq: source.user_id });
- this.elems.unshift(this.elems.pop());
- }
this.elems.unshift({
45: {
1: [source.seq],