mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 07:50:25 +00:00
refactor: packet x1
This commit is contained in:
@@ -28,7 +28,7 @@ export class GetAiCharacters extends GetPacketStatusDepends<Payload, GetAiCharac
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
const rawList = await this.core.apis.PacketApi.sendFetchAiVoiceListReq(+payload.group_id, +(payload.chat_type ?? 1) as AIVoiceChatType);
|
||||
const rawList = await this.core.apis.PacketApi.pkt.operation.FetchAiVoiceList(+payload.group_id, +(payload.chat_type ?? 1) as AIVoiceChatType);
|
||||
return rawList?.map((item) => ({
|
||||
type: item.category,
|
||||
characters: item.voices.map((voice) => ({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { MiniAppInfo, MiniAppInfoHelper } from "@/core/packet/utils/helper/miniAppHelper";
|
||||
import { MiniAppData, MiniAppRawData, MiniAppReqCustomParams, MiniAppReqParams } from "@/core/packet/entities/miniApp";
|
||||
import { MiniAppInfo, MiniAppInfoHelper } from "@/core/packet/helper/miniAppHelper";
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
@@ -77,7 +77,7 @@ export class GetMiniAppArk extends GetPacketStatusDepends<Payload, {
|
||||
}
|
||||
);
|
||||
}
|
||||
const arkData = await this.core.apis.PacketApi.sendMiniAppShareInfoReq(reqParam);
|
||||
const arkData = await this.core.apis.PacketApi.pkt.operation.GetMiniAppAdaptShareInfo(reqParam);
|
||||
return {
|
||||
data: payload.rawArkData ? arkData : MiniAppInfoHelper.RawToSend(arkData)
|
||||
};
|
||||
|
||||
@@ -6,6 +6,6 @@ export class GetRkey extends GetPacketStatusDepends<null, Array<any>> {
|
||||
actionName = ActionName.GetRkey;
|
||||
|
||||
async _handle() {
|
||||
return await this.core.apis.PacketApi.sendRkeyPacket();
|
||||
return await this.core.apis.PacketApi.pkt.operation.FetchRkey();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@ export class GetUserStatus extends GetPacketStatusDepends<Payload, { status: num
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
return await this.core.apis.PacketApi.sendStatusPacket(+payload.user_id);
|
||||
return await this.core.apis.PacketApi.pkt.operation.GetStrangerStatus(+payload.user_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ export class SetGroupSign extends BaseAction<Payload, any> {
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
return await this.core.apis.PacketApi.sendGroupSignPacket(payload.group_id.toString());
|
||||
return await this.core.apis.PacketApi.pkt.operation.GroupSign(+payload.group_id);
|
||||
}
|
||||
}
|
||||
export class SendGroupSign extends SetGroupSign {
|
||||
actionName = ActionName.SendGroupSign;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,6 @@ export class SetSpecialTittle extends GetPacketStatusDepends<Payload, any> {
|
||||
async _handle(payload: Payload) {
|
||||
const uid = await this.core.apis.UserApi.getUidByUinV2(payload.user_id.toString());
|
||||
if(!uid) throw new Error('User not found');
|
||||
await this.core.apis.PacketApi.sendSetSpecialTittlePacket(payload.group_id.toString(), uid, payload.special_title);
|
||||
await this.core.apis.PacketApi.pkt.operation.SetGroupSpecialTitle(+payload.group_id, uid, payload.special_title);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user