fix: send message

This commit is contained in:
Wesley F. Young 2024-09-07 00:51:03 +08:00
parent 31f21176f7
commit 90eb3da7f8

View File

@ -4,7 +4,8 @@ import {
ElementType, ElementType,
NapCatCore, NapCatCore,
Peer, Peer,
RawMessage, ReplyElement, RawMessage,
ReplyElement,
SendMessageElement, SendMessageElement,
SendTextElement, SendTextElement,
} from '@/core'; } from '@/core';
@ -232,7 +233,9 @@ export class LaanaMessageUtils {
}; };
async laanaPeerToRaw(peer: LaanaPeer): Promise<Peer> { async laanaPeerToRaw(peer: LaanaPeer): Promise<Peer> {
const peerUid = await this.core.apis.UserApi.getUidByUinV2(peer.uin); const peerUid = peer.type === Peer_Type.BUDDY ?
await this.core.apis.UserApi.getUidByUinV2(peer.uin) :
peer.uin;
if (!peerUid) { if (!peerUid) {
throw Error('查询用户 UID 失败'); throw Error('查询用户 UID 失败');
} }