NapCatQQ/packages/napcat-onebot/action/group/SendGroupMsg.ts
手瓜一十雪 fd1808e36a Add action examples and enhance action metadata
Introduced a centralized examples.ts file providing payload and return examples for all actions. Updated numerous action classes to include actionDescription, actionTags, payloadExample, and returnExample fields, improving API documentation and discoverability.
2026-01-25 17:45:46 +08:00

25 lines
884 B
TypeScript

import { ContextMode, ReturnDataType, SendMsgBase, SendMsgPayload } from '@/napcat-onebot/action/msg/SendMsg';
import { ActionName, BaseCheckResult } from '@/napcat-onebot/action/router';
import { ActionExamples } from '../examples';
// 未检测参数
class SendGroupMsg extends SendMsgBase {
override actionName = ActionName.SendGroupMsg;
override actionDescription = '发送群消息';
override payloadExample = ActionExamples.SendGroupMsg.payload;
override returnExample = ActionExamples.SendGroupMsg.return;
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;