Skip to content

Commit

Permalink
fix: 修复一点点好友戳一戳
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Dec 18, 2024
1 parent 1eeb755 commit 64940dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions main/src/client/NapCatClient/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ export class NapCatClient extends QQClient {
}

private async handlePoke(data: WSReceiveHandler['notice.notify.poke.group'] | WSReceiveHandler['notice.notify.poke.friend']) {
const chat = 'group_id' in data ? await this.pickGroup(data.group_id) : await this.pickFriend(data.user_id);
const nonSelfId = data.user_id === this.uin ? data.target_id : data.user_id;
const chat = 'group_id' in data ? await this.pickGroup(data.group_id) : await this.pickFriend(nonSelfId);
const operator = 'sender_id' in data ? data.sender_id as number : data.user_id;
const nors: any[] = data.raw_info?.filter(it => (it.type as any) === 'nor') || [];
const event = new PokeEvent(chat, operator, data.target_id, nors[0]?.txt, nors[1]?.txt);
Expand Down Expand Up @@ -249,7 +250,7 @@ export class NapCatClient extends QQClient {
message: {
type: 'text',
text: title,
}
},
});
}
return res;
Expand Down
2 changes: 1 addition & 1 deletion main/src/services/ForwardService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ export default class ForwardService {
const tempFiles: FileResult[] = [];
let chain: (string | SendableElem)[] = [];
const senderId = Number(message.senderId || message.sender?.id) || helper.peerToId(message.peerId);
console.debug('senderId', senderId);
this.log.debug('senderId', senderId);
// 这条消息在 tg 中被回复的时候显示的
let brief = '', isSpoilerPhoto = false;
let userDisplayName = helper.getUserDisplayName(message.sender);
Expand Down

0 comments on commit 64940dd

Please sign in to comment.