diff --git a/src/core/packet/context/operationContext.ts b/src/core/packet/context/operationContext.ts index 76866709..3f822dad 100644 --- a/src/core/packet/context/operationContext.ts +++ b/src/core/packet/context/operationContext.ts @@ -31,12 +31,12 @@ export class PacketOperationContext { } async GroupPoke(groupUin: number, uin: number) { - const req = trans.SendPoke.build(uin, groupUin); + const req = trans.SendPoke.build(true, uin, groupUin); await this.context.client.sendOidbPacket(req); } - async FriendPoke(uin: number) { - const req = trans.SendPoke.build(uin); + async FriendPoke(uin: number, target?: number) { + const req = trans.SendPoke.build(false, uin, target ?? uin); await this.context.client.sendOidbPacket(req); } diff --git a/src/core/packet/transformer/action/SendPoke.ts b/src/core/packet/transformer/action/SendPoke.ts index 4067e48d..8ff5dc27 100644 --- a/src/core/packet/transformer/action/SendPoke.ts +++ b/src/core/packet/transformer/action/SendPoke.ts @@ -8,7 +8,7 @@ class SendPoke extends PacketTransformer { super(); } - build(peer: number, group?: number): OidbPacket { + build(is_group: boolean, peer: number, group?: number): OidbPacket { const data = new NapProtoMsg(proto.OidbSvcTrpcTcp0XED3_1).encode({ uin: peer, groupUin: group, diff --git a/src/core/packet/transformer/oidb/oidbBase.ts b/src/core/packet/transformer/oidb/oidbBase.ts index 83cf0ee4..632a4b10 100644 --- a/src/core/packet/transformer/oidb/oidbBase.ts +++ b/src/core/packet/transformer/oidb/oidbBase.ts @@ -7,7 +7,7 @@ class OidbBase extends PacketTransformer { super(); } - build(cmd: number, subCmd: number, body: Uint8Array, isUid: boolean = true, isLafter: boolean = false): OidbPacket { + build(cmd: number, subCmd: number, body: Uint8Array, isUid: boolean = true, _isLafter: boolean = false): OidbPacket { const data = new NapProtoMsg(proto.OidbSvcTrpcTcpBase).encode({ command: cmd, subCommand: subCmd, diff --git a/src/onebot/action/packet/SendPoke.ts b/src/onebot/action/packet/SendPoke.ts index 5cdf74c1..f459175c 100644 --- a/src/onebot/action/packet/SendPoke.ts +++ b/src/onebot/action/packet/SendPoke.ts @@ -5,6 +5,7 @@ import { Static, Type } from '@sinclair/typebox'; const SchemaData = Type.Object({ group_id: Type.Optional(Type.Union([Type.Number(), Type.String()])), user_id: Type.Union([Type.Number(), Type.String()]), + target_id: Type.Union([Type.Number(), Type.String()]), }); type Payload = Static; @@ -17,7 +18,7 @@ export class SendPoke extends GetPacketStatusDepends { if (payload.group_id) { await this.core.apis.PacketApi.pkt.operation.GroupPoke(+payload.group_id, +payload.user_id); } else { - await this.core.apis.PacketApi.pkt.operation.FriendPoke(+payload.user_id); + await this.core.apis.PacketApi.pkt.operation.FriendPoke(+payload.user_id, payload.target_id ? +payload.target_id : undefined); } } } diff --git a/src/onebot/action/user/FriendPoke.ts b/src/onebot/action/user/FriendPoke.ts index e447a987..2a84ab28 100644 --- a/src/onebot/action/user/FriendPoke.ts +++ b/src/onebot/action/user/FriendPoke.ts @@ -3,7 +3,8 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus'; import { Static, Type } from '@sinclair/typebox'; const SchemaData = Type.Object({ - user_id: Type.Union([Type.Number(), Type.String()]) + user_id: Type.Number(), + target_id: Type.Union([Type.Number(), Type.String()]), }); type Payload = Static; @@ -13,6 +14,6 @@ export class FriendPoke extends GetPacketStatusDepends { override payloadSchema = SchemaData; async _handle(payload: Payload) { - await this.core.apis.PacketApi.pkt.operation.FriendPoke(+payload.user_id); + await this.core.apis.PacketApi.pkt.operation.FriendPoke(payload.user_id, payload.target_id ? +payload.target_id : undefined); } }