mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-08 12:09:00 +08:00
Improve senderUin handling in sendMsg method
If senderUin is missing or '0', attempt to retrieve it using senderUid before returning. This ensures messages are not dropped when senderUid is available but senderUin is not.
This commit is contained in:
parent
47983e2915
commit
71bb4f68f3
@ -984,8 +984,20 @@ export class OneBotMsgApi {
|
||||
disableGetUrl: boolean = false,
|
||||
quick_reply: boolean = false
|
||||
) {
|
||||
if (msg.senderUin === '0' || msg.senderUin === '') return;
|
||||
if (msg.peerUin === '0' || msg.peerUin === '') return;
|
||||
if ((msg.senderUin === '0' || msg.senderUin === '')) {
|
||||
if (msg.senderUid && msg.senderUid !== '' && msg.senderUid !== '0') {
|
||||
msg.senderUin = await this.core.apis.UserApi.getUinByUidV2(msg.senderUid);
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
if (msg.peerUin === '0' || msg.peerUin === '') {
|
||||
if (msg.peerUid && msg.peerUid !== '' && msg.peerUid !== '0') {
|
||||
msg.peerUin = await this.core.apis.UserApi.getUinByUidV2(msg.peerUid);
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
const resMsg = this.initializeMessage(msg);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user