This commit is contained in:
yysforget 2024-07-15 11:49:38 +08:00
parent b450b7f08b
commit 1c9e390178
3 changed files with 9 additions and 6 deletions

View file

@ -9,10 +9,10 @@ export class ZZZPlugin extends plugin {
* @returns {Promise<string>}
*/
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');

View file

@ -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,