mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-05 15:11:15 +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.
29 lines
899 B
TypeScript
29 lines
899 B
TypeScript
import { ContextMode, ReturnDataType, SendMsgBase, SendMsgPayload } from './SendMsg';
|
|
import { ActionName, BaseCheckResult } from '@/napcat-onebot/action/router';
|
|
|
|
// 未检测参数
|
|
class SendPrivateMsg extends SendMsgBase {
|
|
override actionName = ActionName.SendPrivateMsg;
|
|
override actionSummary = '发送私聊消息';
|
|
override actionDescription = '发送私聊消息';
|
|
override actionTags = ['消息接口'];
|
|
override payloadExample = {
|
|
user_id: '123456789',
|
|
message: 'hello'
|
|
};
|
|
override returnExample = {
|
|
message_id: 123456
|
|
};
|
|
|
|
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;
|