mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-04 22:51:13 +00:00
Added or updated actionSummary, actionTags, payloadExample, and returnExample properties for all OneBot action classes in the napcat-onebot package. This improves API documentation and discoverability by providing concise summaries, categorization tags, and usage examples for each action.
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { GetPacketStatusDepends } from '@/napcat-onebot/action/packet/GetPacketStatus';
|
|
import { ActionName } from '@/napcat-onebot/action/router';
|
|
import { Static, Type } from '@sinclair/typebox';
|
|
|
|
const PayloadSchema = Type.Object({
|
|
group_id: Type.String({ description: '群号' }),
|
|
});
|
|
|
|
type PayloadType = Static<typeof PayloadSchema>;
|
|
|
|
const ReturnSchema = Type.Void({ description: '打卡结果' });
|
|
|
|
type ReturnType = Static<typeof ReturnSchema>;
|
|
|
|
class SetGroupSignBase extends GetPacketStatusDepends<PayloadType, ReturnType> {
|
|
override payloadSchema = PayloadSchema;
|
|
override returnSchema = ReturnSchema;
|
|
override actionSummary = '设置群签名';
|
|
override actionTags = ['群扩展'];
|
|
override payloadExample = {
|
|
group_id: '123456789'
|
|
};
|
|
override returnExample = null;
|
|
|
|
async _handle (payload: PayloadType) {
|
|
return await this.core.apis.PacketApi.pkt.operation.GroupSign(+payload.group_id);
|
|
}
|
|
}
|
|
|
|
export class SetGroupSign extends SetGroupSignBase {
|
|
override actionName = ActionName.SetGroupSign;
|
|
}
|
|
|
|
export class SendGroupSign extends SetGroupSignBase {
|
|
override actionName = ActionName.SendGroupSign;
|
|
}
|