From 1c9e390178d186060385df36b95e2c02ae7db693 Mon Sep 17 00:00:00 2001 From: yysforget <1121504223@qq.com> Date: Mon, 15 Jul 2024 11:49:38 +0800 Subject: [PATCH] feat:at --- lib/plugin.js | 12 +++++++----- lib/render.js | 1 + resources/common/layout/playerinfo.html | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/plugin.js b/lib/plugin.js index caf9963..2010b66 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -9,10 +9,10 @@ export class ZZZPlugin extends plugin { * @returns {Promise} */ async getUID() { - const user = this.e; - // if (this.e.at) { - // user = this.e.at; - // } + let user = this.e; + if (this.e.at) { + user = this.e.at; + } this.User = await NoteUser.create(user); // let uid = this.e.msg.match(/\d+/)?.[0]; const uid = this.User?.getUid('zzz'); @@ -29,7 +29,9 @@ export class ZZZPlugin extends plugin { async getAPI() { let uid = await this.getUID(); if (!uid) return false; - + if (this.e.at) { + this.e.user_id = this.e.at; + } const ck = await getCk(this.e); if (!ck || Object.keys(ck).filter(k => ck[k].ck).length === 0) { await this.reply('尚未绑定cookie,请先绑定cookie'); diff --git a/lib/render.js b/lib/render.js index 7441fa7..6e7b6e2 100644 --- a/lib/render.js +++ b/lib/render.js @@ -38,6 +38,7 @@ function render(e, renderPath, renderData = {}, cfg = {}) { return { player: e?.playerCard?.player, avatar: e?.playerCard?.avatar, + qqId: e?.at || e.user_id, ...data, _res_path: resPath, _layout_path: layoutPath, diff --git a/resources/common/layout/playerinfo.html b/resources/common/layout/playerinfo.html index 29bc3f4..fb30609 100644 --- a/resources/common/layout/playerinfo.html +++ b/resources/common/layout/playerinfo.html @@ -1,7 +1,7 @@
- Avatar + Avatar