feat: 群成员资料信息显示生日

This commit is contained in:
Clansty 2024-05-09 02:04:27 +08:00
parent 853f041668
commit 6b913beb8f
4 changed files with 25 additions and 10 deletions

View File

@ -111,6 +111,12 @@
<% if(location) { %>
<div class="secondary"><%= location %></div>
<% } %>
<% if(birthday) { %>
<div class="detailItem">
<div class="secondary">生日</div>
<%= birthday %>
</div>
<% } %>
<div class="detailItem">
<div class="secondary">加入时间</div>
<%= joinTime %>

View File

@ -39,6 +39,7 @@ export default ((fastify, opts, done) => {
email: profile.email,
qid: profile.QID,
signature: profile.signature,
birthday: (profile.birthday || []).join('/'),
});
});

View File

@ -1,8 +1,8 @@
diff --git a/lib/common.d.ts b/lib/common.d.ts
index d27f6298a041607768ee58b0d1e75c8bdcedafe1..a31f71a429a8395f727793e8f14445bf3b502a0c 100644
index d27f6298a041607768ee58b0d1e75c8bdcedafe1..d4d90b2ef8b63baf1edb84b0ab3118bbf421c515 100644
--- a/lib/common.d.ts
+++ b/lib/common.d.ts
@@ -54,5 +54,10 @@ export interface UserProfile {
@@ -54,5 +54,11 @@ export interface UserProfile {
signature: string;
/** 自定义的QID */
QID: string;
@ -11,13 +11,14 @@ index d27f6298a041607768ee58b0d1e75c8bdcedafe1..a31f71a429a8395f727793e8f14445bf
+ 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..6d129f1dada9e2af13b7bb5282eeafbefab816be 100644
index ee137c44c92b947dcc7d851bb04f319c9a070f68..4bb7d5d082156f76974269e220051539162792dd 100644
--- a/lib/internal/internal.js
+++ b/lib/internal/internal.js
@@ -86,6 +86,11 @@ async function getUserProfile(uin = this.uin) {
@@ -86,9 +86,17 @@ async function getUserProfile(uin = this.uin) {
});
// 有需要自己加!
return {
@ -28,7 +29,14 @@ index ee137c44c92b947dcc7d851bb04f319c9a070f68..6d129f1dada9e2af13b7bb5282eeafbe
+ email: String(profile[20011]),
signature: String(profile[102]),
regTimestamp: profile[20026],
QID: String(profile[27394])
- 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..d6156587a02b1ed441ac8d2a3e2104e6343306b2 100644
--- a/lib/message/converter.js

View File

@ -6,7 +6,7 @@ settings:
patchedDependencies:
'@icqqjs/icqq@1.2.0':
hash: 6yho2mmridqmfssxk3qnzdaelu
hash: wkoe3yspe5fefr6roinm5qebhu
path: patches/@icqqjs__icqq@1.2.0.patch
importers:
@ -27,7 +27,7 @@ importers:
version: 7.0.3
'@icqqjs/icqq':
specifier: 1.2.0
version: 1.2.0(patch_hash=6yho2mmridqmfssxk3qnzdaelu)
version: 1.2.0(patch_hash=wkoe3yspe5fefr6roinm5qebhu)
'@prisma/client':
specifier: 5.13.0
version: 5.13.0(prisma@5.13.0)
@ -102,7 +102,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%25252525252Brevert_media/telegram-2.19.10.tgz'
version: '@github.com/clansty/gramjs/releases/download/2.19.10%252525252525252Brevert_media/telegram-2.19.10.tgz'
tmp-promise:
specifier: ^3.0.3
version: 3.0.3
@ -805,7 +805,7 @@ packages:
glob: 10.3.12
dev: false
/@icqqjs/icqq@1.2.0(patch_hash=6yho2mmridqmfssxk3qnzdaelu):
/@icqqjs/icqq@1.2.0(patch_hash=wkoe3yspe5fefr6roinm5qebhu):
resolution: {integrity: sha512-/BypCM8jlQC2OtoyVuf6aYuMBNJ122zez5gt4MOTsEetCrouxX1zVE2yGv6bbAOkzFA4JuMnwrIJL+pr2hP2ag==, tarball: https://npm.pkg.github.com/download/@icqqjs/icqq/1.2.0/a2f26dae19b894a37865e730fc639e251f169d17}
engines: {node: '>= v14'}
dependencies:
@ -5747,7 +5747,7 @@ packages:
- utf-8-validate
dev: false
'@github.com/clansty/gramjs/releases/download/2.19.10%25252525252Brevert_media/telegram-2.19.10.tgz':
'@github.com/clansty/gramjs/releases/download/2.19.10%252525252525252Brevert_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