mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
fix: playerinfo
This commit is contained in:
parent
08be225ffc
commit
e402889dc5
1 changed files with 3 additions and 2 deletions
|
|
@ -84,13 +84,14 @@ export class ZZZPlugin extends plugin {
|
|||
*/
|
||||
async getPlayerInfo() {
|
||||
// 获取 米游社 API
|
||||
const { api } = await this.getAPI();
|
||||
const { api, uid } = await this.getAPI();
|
||||
if (!api) return false;
|
||||
// 获取用户信息
|
||||
let userData = await api.getFinalData(this.e, 'zzzUser');
|
||||
if (!userData) return false;
|
||||
// 取第一个用户信息
|
||||
userData = userData?.list[0];
|
||||
userData =
|
||||
userData?.list?.find(item => item.game_uid == uid) || userData?.list?.[0];
|
||||
|
||||
// 获取用户头像
|
||||
let avatar = this.e?.bot?.avatar || '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue