新增all_poke

This commit is contained in:
Shua-github 2024-12-27 00:24:35 +08:00
parent 9cd15ae337
commit a9e471deca
4 changed files with 28 additions and 1 deletions

View File

@ -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));
}
}

View File

@ -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];

View 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);
}
}

View File

@ -145,4 +145,6 @@ export const ActionName = {
SendGroupAiRecord: "send_group_ai_record",
GetClientkey: "get_clientkey",
AllPoke: 'all_poke',
} as const;