Merge pull request #52 from SmallK111407/main

尝试修复 TRSS-Yunzai 非icqq协议无法正常获取头像
This commit is contained in:
bietiaop 2024-08-19 08:50:14 +08:00 committed by GitHub
commit 7bdcc1d936
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -256,7 +256,7 @@ export default class MysZZZApi extends MysApi {
case 10041: case 10041:
case 5003: case 5003:
this.e.reply( this.e.reply(
`UID:${this.uid},米游社账号异常,暂时无法查询,请尝试%绑定设备` `UID:${this.uid},米游社账号异常,暂时无法查询,请尝试 %绑定设备帮助`
); );
break; break;
case 10035: case 10035:

View file

@ -191,13 +191,13 @@ export class ZZZPlugin extends plugin {
userData?.list?.find(item => item.game_uid == uid) || userData?.list?.[0]; userData?.list?.find(item => item.game_uid == uid) || userData?.list?.[0];
// 获取用户头像 // 获取用户头像
let avatar = this.e?.bot?.avatar || ''; let avatar = '';
if (this.e?.user_id) { if (this.e.member?.getAvatarUrl) {
avatar = `https://q1.qlogo.cn/g?b=qq&s=0&nk=${this.e.user_id}`;
} else if (this.e.member?.getAvatarUrl) {
avatar = await this.e.member.getAvatarUrl(); avatar = await this.e.member.getAvatarUrl();
} else if (this.e.friend?.getAvatarUrl) { } else if (this.e.friend?.getAvatarUrl) {
avatar = await this.e.friend.getAvatarUrl(); avatar = await this.e.friend.getAvatarUrl();
} else {
avatar = this.e?.bot?.avatar
} }
// 写入数据 // 写入数据
this.e.playerCard = { this.e.playerCard = {