mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-05 07:01:16 +00:00
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.
25 lines
890 B
TypeScript
25 lines
890 B
TypeScript
import { ContextMode, ReturnDataType, SendMsgBase, SendMsgPayload } from './SendMsg';
|
|
import { ActionName, BaseCheckResult } from '@/napcat-onebot/action/router';
|
|
|
|
import { ActionExamples } from '../examples';
|
|
|
|
// 未检测参数
|
|
class SendPrivateMsg extends SendMsgBase {
|
|
override actionName = ActionName.SendPrivateMsg;
|
|
override actionDescription = '发送私聊消息';
|
|
override actionTags = ['消息接口'];
|
|
override payloadExample = ActionExamples.SendPrivateMsg.payload;
|
|
override returnExample = ActionExamples.SendPrivateMsg.return;
|
|
|
|
protected override async check (payload: SendMsgPayload): Promise<BaseCheckResult> {
|
|
payload.message_type = 'private';
|
|
return super.check(payload);
|
|
}
|
|
|
|
override async _handle (payload: SendMsgPayload): Promise<ReturnDataType> {
|
|
return this.base_handle(payload, ContextMode.Private);
|
|
}
|
|
}
|
|
|
|
export default SendPrivateMsg;
|