mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-26 10:41:20 +08:00
* feat: pnpm new * Refactor build and release workflows, update dependencies Switch build scripts and workflows from npm to pnpm, update build and artifact paths, and simplify release workflow by removing version detection and changelog steps. Add new dependencies (silk-wasm, express, ws, node-pty-prebuilt-multiarch), update exports in package.json files, and add vite config for napcat-framework. Also, rename manifest.json for framework package and fix static asset copying in shell build config.
31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
import { MessageUnique } from 'napcat-common/src/message-unique';
|
|
import { ChatType, Peer } from 'napcat-core';
|
|
import { GetPacketStatusDepends } from '@/napcat-onebot/action/packet/GetPacketStatus';
|
|
import { Static, Type } from '@sinclair/typebox';
|
|
import { ActionName } from '../router';
|
|
|
|
const SchemaData = Type.Object({
|
|
group_id: Type.String(),
|
|
message_id: Type.String(),
|
|
message_seq: Type.Optional(Type.String()),
|
|
});
|
|
|
|
type Payload = Static<typeof SchemaData>;
|
|
export class SetGroupTodo extends GetPacketStatusDepends<Payload, void> {
|
|
override payloadSchema = SchemaData;
|
|
override actionName = ActionName.SetGroupTodo;
|
|
async _handle (payload: Payload) {
|
|
if (payload.message_seq) {
|
|
return await this.core.apis.PacketApi.pkt.operation.SetGroupTodo(+payload.group_id, payload.message_seq);
|
|
}
|
|
const peer: Peer = {
|
|
chatType: ChatType.KCHATTYPEGROUP,
|
|
peerUid: payload.group_id,
|
|
};
|
|
const { MsgId, Peer } = MessageUnique.getMsgIdAndPeerByShortId(+payload.message_id) ?? { Peer: peer, MsgId: payload.message_id };
|
|
const msg = (await this.core.apis.MsgApi.getMsgsByMsgId(Peer, [MsgId])).msgList[0];
|
|
if (!msg) throw new Error('消息不存在');
|
|
await this.core.apis.PacketApi.pkt.operation.SetGroupTodo(+payload.group_id, msg.msgSeq);
|
|
}
|
|
}
|