mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-05 07:01:16 +00:00
Introduces the actionSummary property to OneBotAction and updates all action classes to provide concise summaries and improved descriptions. Refactors example imports for better modularity, adds new example files for guild and packet actions, and updates the OpenAPI schema generator to use the new summary and improved descriptions. This enhances API documentation clarity and consistency.
27 lines
991 B
TypeScript
27 lines
991 B
TypeScript
import { ContextMode, ReturnDataType, SendMsgBase, SendMsgPayload } from '@/napcat-onebot/action/msg/SendMsg';
|
|
import { ActionName, BaseCheckResult } from '@/napcat-onebot/action/router';
|
|
|
|
import { GroupActionsExamples } from './examples';
|
|
|
|
// 未检测参数
|
|
class SendGroupMsg extends SendMsgBase {
|
|
override actionName = ActionName.SendGroupMsg;
|
|
override actionSummary = '发送群消息';
|
|
override actionDescription = '发送群消息';
|
|
override actionTags = ['群组接口'];
|
|
override payloadExample = GroupActionsExamples.SendGroupMsg.payload;
|
|
override returnExample = GroupActionsExamples.SendGroupMsg.response;
|
|
|
|
protected override async check (payload: SendMsgPayload): Promise<BaseCheckResult> {
|
|
delete payload.user_id;
|
|
payload.message_type = 'group';
|
|
return super.check(payload);
|
|
}
|
|
|
|
override async _handle (payload: SendMsgPayload): Promise<ReturnDataType> {
|
|
return this.base_handle(payload, ContextMode.Group);
|
|
}
|
|
}
|
|
|
|
export default SendGroupMsg;
|