mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-24 09:00:06 +08:00
新增all_poke
This commit is contained in:
parent
9cd15ae337
commit
a9e471deca
@ -148,4 +148,8 @@ export class PacketOperationContext {
|
||||
return res.msgInfo;
|
||||
}
|
||||
}
|
||||
|
||||
async AllPoke(uin: number, groupUin?: number) {
|
||||
await (groupUin ? this.GroupPoke(uin,groupUin) : this.FriendPoke(uin));
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,7 +104,8 @@ import { GetGuildList } from './guild/GetGuildList';
|
||||
import { GetGuildProfile } from './guild/GetGuildProfile';
|
||||
import { GetClientkey } from './extends/GetClientkey';
|
||||
import { SendPacket } from './extends/SendPacket';
|
||||
|
||||
import { AllPoke } from "@/onebot/action/packet/AllPoke";
|
||||
|
||||
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||
|
||||
const actionHandlers = [
|
||||
@ -220,6 +221,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
|
||||
new SendGroupAiRecord(obContext, core),
|
||||
new GetAiCharacters(obContext, core),
|
||||
new SendPacket(obContext, core),
|
||||
new AllPoke(obContext, core),
|
||||
];
|
||||
|
||||
type HandlerUnion = typeof actionHandlers[number];
|
||||
|
||||
19
src/onebot/action/packet/AllPoke.ts
Normal file
19
src/onebot/action/packet/AllPoke.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
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()]),
|
||||
});
|
||||
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export class AllPoke extends GetPacketStatusDepends<Payload, any> {
|
||||
actionName = ActionName.AllPoke;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
await this.core.apis.PacketApi.pkt.operation.AllPoke(+payload.user_id, payload.group_id ? +payload.group_id : undefined);
|
||||
}
|
||||
}
|
||||
@ -145,4 +145,6 @@ export const ActionName = {
|
||||
SendGroupAiRecord: "send_group_ai_record",
|
||||
|
||||
GetClientkey: "get_clientkey",
|
||||
|
||||
AllPoke: 'all_poke',
|
||||
} as const;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user