fix: 使用 NFT 用户名时 @ 自己的消息出现 @null 的情况

This commit is contained in:
Clansty 2024-01-14 16:17:48 +08:00
parent e91af9426b
commit b555a4caec
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
1 changed files with 3 additions and 1 deletions

View File

@ -351,7 +351,9 @@ export default class ForwardService {
}
if (this.instance.workMode === 'personal' && event.message_type === 'group' && event.atme && !replyTo) {
message += `\n<b>@${this.instance.userMe.username}</b>`;
message += `\n<b>@${this.instance.userMe.usernames?.length ?
this.instance.userMe.usernames[0].username :
this.instance.userMe.username}</b>`;
}
// 发送消息