mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 13:01:14 +00:00
fix
This commit is contained in:
parent
968bd7a437
commit
8f4f898675
@ -53,7 +53,7 @@ export class NTQQGroupApi {
|
|||||||
uids,
|
uids,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
async sendPacketPoke(group: string, peer: string) {
|
async sendPacketPoke(group: number, peer: number) {
|
||||||
let data = encodeGroupPoke(group, peer);
|
let data = encodeGroupPoke(group, peer);
|
||||||
let hex = Buffer.from(data).toString('hex');
|
let hex = Buffer.from(data).toString('hex');
|
||||||
let retdata = await this.core.apis.PacketApi.sendPacket('OidbSvcTrpcTcp.0xed3_1', hex, false);
|
let retdata = await this.core.apis.PacketApi.sendPacket('OidbSvcTrpcTcp.0xed3_1', hex, false);
|
||||||
|
@ -14,11 +14,11 @@ export const OidbSvcTrpcTcp0XED3_1 = new MessageType("oidb_svc_trpctcp_0xed3_1",
|
|||||||
{ no: 6, name: "ext", kind: "scalar", T: ScalarType.UINT32 }
|
{ no: 6, name: "ext", kind: "scalar", T: ScalarType.UINT32 }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export function encodeGroupPoke(groupUin: string, PeerUin: string) {
|
export function encodeGroupPoke(groupUin: number, PeerUin: number) {
|
||||||
let Body = OidbSvcTrpcTcp0XED3_1.toBinary
|
let Body = OidbSvcTrpcTcp0XED3_1.toBinary
|
||||||
({
|
({
|
||||||
uin: parseInt(PeerUin),
|
uin: PeerUin,
|
||||||
groupuin: parseInt(groupUin),
|
groupuin: groupUin,
|
||||||
ext: 0
|
ext: 0
|
||||||
});
|
});
|
||||||
//console.log(Body)
|
//console.log(Body)
|
||||||
|
26
src/onebot/action/group/GroupPoke.ts
Normal file
26
src/onebot/action/group/GroupPoke.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import BaseAction from '../BaseAction';
|
||||||
|
import { ActionName } from '../types';
|
||||||
|
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||||
|
// no_cache get时传字符串
|
||||||
|
const SchemaData = {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
group_id: { type: ['number', 'string'] },
|
||||||
|
user_id: { type: ['number', 'string'] },
|
||||||
|
},
|
||||||
|
required: ['group_id', 'user_id'],
|
||||||
|
} as const satisfies JSONSchema;
|
||||||
|
|
||||||
|
type Payload = FromSchema<typeof SchemaData>;
|
||||||
|
|
||||||
|
export class GroupPoke extends BaseAction<Payload, any> {
|
||||||
|
actionName = ActionName.GetGroupList;
|
||||||
|
payloadSchema = SchemaData;
|
||||||
|
|
||||||
|
async _handle(payload: Payload) {
|
||||||
|
if (!this.core.apis.PacketApi.PacketClient?.isConnected) {
|
||||||
|
throw new Error('PacketClient is not init');
|
||||||
|
}
|
||||||
|
this.core.apis.GroupApi.sendPacketPoke(+payload.group_id, +payload.user_id);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user