mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-04 14:41:14 +00:00
AI修正部分api文档
This commit is contained in:
parent
d7f0dbe2f2
commit
0bf9c9efc4
@ -22,12 +22,14 @@ export class ClickInlineKeyboardButton extends OneBotAction<PayloadType, ReturnT
|
||||
override returnSchema = ReturnSchema; override actionSummary = '点击内联键盘按钮';
|
||||
override actionTags = ['消息扩展'];
|
||||
override payloadExample = {
|
||||
message_id: 12345,
|
||||
button_id: 'btn_1'
|
||||
group_id: '123456',
|
||||
bot_appid: '1234567890',
|
||||
button_id: 'btn_1',
|
||||
callback_data: '',
|
||||
msg_seq: '10086'
|
||||
};
|
||||
override returnExample = {
|
||||
result: true
|
||||
};
|
||||
} as any;
|
||||
async _handle (payload: PayloadType) {
|
||||
return await this.core.apis.MsgApi.clickInlineKeyboardButton({
|
||||
buttonId: payload.button_id,
|
||||
|
||||
@ -33,10 +33,25 @@ export class FetchEmojiLike extends OneBotAction<PayloadType, ReturnType> {
|
||||
override actionSummary = '获取表情点赞详情';
|
||||
override actionTags = ['消息扩展'];
|
||||
override payloadExample = {
|
||||
message_id: 12345
|
||||
message_id: 12345,
|
||||
emojiId: '123',
|
||||
emojiType: 1,
|
||||
count: 10,
|
||||
cookie: ''
|
||||
};
|
||||
override returnExample = {
|
||||
likes: [{ emoji_id: '123', count: 10 }]
|
||||
emojiLikesList: [
|
||||
{
|
||||
tinyId: '123456',
|
||||
nickName: '测试用户',
|
||||
headUrl: 'http://example.com/avatar.png'
|
||||
}
|
||||
],
|
||||
cookie: '',
|
||||
isLastPage: true,
|
||||
isFirstPage: true,
|
||||
result: 0,
|
||||
errMsg: ''
|
||||
};
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
|
||||
@ -29,10 +29,16 @@ export class GetEmojiLikes extends OneBotAction<PayloadType, ReturnType> {
|
||||
override actionSummary = '获取消息表情点赞列表';
|
||||
override actionTags = ['消息扩展'];
|
||||
override payloadExample = {
|
||||
message_id: 12345
|
||||
message_id: '12345',
|
||||
emoji_id: '123'
|
||||
};
|
||||
override returnExample = {
|
||||
likes: [{ emoji_id: '123', user_id: 654321 }]
|
||||
emoji_like_list: [
|
||||
{
|
||||
user_id: '654321',
|
||||
nick_name: '测试用户'
|
||||
}
|
||||
]
|
||||
};
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
|
||||
@ -16,10 +16,10 @@ export class GetGroupInfoEx extends OneBotAction<PayloadType, ReturnType> {
|
||||
override actionSummary = '获取群详细信息 (扩展)';
|
||||
override actionTags = ['群组扩展'];
|
||||
override payloadExample = {
|
||||
group_id: 123456
|
||||
group_id: '123456'
|
||||
};
|
||||
override returnExample = {
|
||||
|
||||
|
||||
};
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
|
||||
@ -48,10 +48,16 @@ export class GetMiniAppArk extends GetPacketStatusDepends<PayloadType, ReturnTyp
|
||||
override returnSchema = ReturnSchema; override actionSummary = '获取小程序 Ark';
|
||||
override actionTags = ['系统扩展'];
|
||||
override payloadExample = {
|
||||
app_id: 'wx123456'
|
||||
type: 'bili',
|
||||
title: '测试标题',
|
||||
desc: '测试描述',
|
||||
picUrl: 'http://example.com/pic.jpg',
|
||||
jumpUrl: 'http://example.com'
|
||||
};
|
||||
override returnExample = {
|
||||
ark: 'ark_content'
|
||||
data: {
|
||||
ark: 'ark_content'
|
||||
}
|
||||
};
|
||||
async _handle (payload: PayloadType) {
|
||||
let reqParam: MiniAppReqParams;
|
||||
|
||||
@ -20,11 +20,14 @@ export class GetQunAlbumList extends OneBotAction<PayloadType, GetQunAlbumListRe
|
||||
override payloadExample = {
|
||||
group_id: '123456',
|
||||
};
|
||||
override returnExample = {
|
||||
album_list: [
|
||||
{}
|
||||
]
|
||||
};
|
||||
override returnExample = [
|
||||
{
|
||||
album_id: 'album_1',
|
||||
album_name: '测试相册',
|
||||
cover_url: 'http://example.com/cover.jpg',
|
||||
create_time: 1734567890
|
||||
}
|
||||
];
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
|
||||
|
||||
@ -23,12 +23,13 @@ export class MoveGroupFile extends GetPacketStatusDepends<PayloadType, ReturnTyp
|
||||
override actionSummary = '移动群文件';
|
||||
override actionTags = ['文件扩展'];
|
||||
override payloadExample = {
|
||||
group_id: 123456,
|
||||
group_id: '123456',
|
||||
file_id: '/file_id',
|
||||
parent_id: '/target_folder_id'
|
||||
current_parent_directory: '/current_folder_id',
|
||||
target_parent_directory: '/target_folder_id',
|
||||
};
|
||||
override returnExample = {
|
||||
result: true
|
||||
ok: true
|
||||
};
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
|
||||
@ -20,7 +20,7 @@ class OCRImageBase extends OneBotAction<PayloadType, ReturnType> {
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
override actionSummary = '图片 OCR 识别';
|
||||
override actionDescription = '识别图片中的文字内容';
|
||||
override actionDescription = '识别图片中的文字内容(仅Windows端支持)';
|
||||
override actionTags = ['扩展接口'];
|
||||
override payloadExample = ExtendsActionsExamples.OCRImage.payload;
|
||||
override returnExample = ExtendsActionsExamples.OCRImage.response;
|
||||
|
||||
@ -23,12 +23,13 @@ export class RenameGroupFile extends GetPacketStatusDepends<PayloadType, ReturnT
|
||||
override actionSummary = '重命名群文件';
|
||||
override actionTags = ['文件扩展'];
|
||||
override payloadExample = {
|
||||
group_id: 123456,
|
||||
group_id: '123456',
|
||||
file_id: '/file_id',
|
||||
name: 'new_name.jpg'
|
||||
current_parent_directory: '/',
|
||||
new_name: 'new_name.jpg'
|
||||
};
|
||||
override returnExample = {
|
||||
result: true
|
||||
ok: true
|
||||
};
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
|
||||
@ -21,11 +21,11 @@ export class SetDiyOnlineStatus extends OneBotAction<PayloadType, ReturnType> {
|
||||
override actionDescription = '设置自定义在线状态';
|
||||
override actionTags = ['用户扩展'];
|
||||
override payloadExample = {
|
||||
status: 11
|
||||
};
|
||||
override returnExample = {
|
||||
result: 0
|
||||
face_id: '123',
|
||||
face_type: '1',
|
||||
wording: '自定义状态'
|
||||
};
|
||||
override returnExample = '';
|
||||
async _handle (payload: PayloadType) {
|
||||
const ret = await this.core.apis.UserApi.setDiySelfOnlineStatus(
|
||||
payload.face_id.toString(),
|
||||
|
||||
@ -23,9 +23,7 @@ export default class SetGroupAddOption extends OneBotAction<PayloadType, ReturnT
|
||||
group_id: '123456',
|
||||
add_type: 1,
|
||||
};
|
||||
override returnExample = {
|
||||
result: null
|
||||
};
|
||||
override returnExample = null;
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
async _handle (payload: PayloadType): Promise<ReturnType> {
|
||||
|
||||
@ -21,9 +21,7 @@ export default class SetGroupRobotAddOption extends OneBotAction<PayloadType, Re
|
||||
override payloadExample = {
|
||||
group_id: '123456'
|
||||
};
|
||||
override returnExample = {
|
||||
result: null
|
||||
};
|
||||
override returnExample = null;
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
async _handle (payload: PayloadType): Promise<ReturnType> {
|
||||
|
||||
@ -21,9 +21,7 @@ export default class SetGroupSearch extends OneBotAction<PayloadType, ReturnType
|
||||
override payloadExample = {
|
||||
group_id: '123456'
|
||||
};
|
||||
override returnExample = {
|
||||
result: null
|
||||
};
|
||||
override returnExample = null;
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
async _handle (payload: PayloadType): Promise<ReturnType> {
|
||||
|
||||
@ -21,12 +21,11 @@ export class TransGroupFile extends GetPacketStatusDepends<PayloadType, ReturnTy
|
||||
override actionSummary = '传输群文件';
|
||||
override actionTags = ['文件扩展'];
|
||||
override payloadExample = {
|
||||
group_id: 123456,
|
||||
file_id: '/file_id',
|
||||
target_group_id: 654321
|
||||
group_id: '123456',
|
||||
file_id: '/file_id'
|
||||
};
|
||||
override returnExample = {
|
||||
result: true
|
||||
ok: true
|
||||
};
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
|
||||
@ -10,7 +10,9 @@ const PayloadSchema = Type.Object({
|
||||
|
||||
type PayloadType = Static<typeof PayloadSchema>;
|
||||
|
||||
const ReturnSchema = Type.Union([Type.Array(Type.Any()), Type.Undefined()], { description: '翻译结果列表' });
|
||||
const ReturnSchema = Type.Object({
|
||||
words: Type.Array(Type.String(), { description: '翻译结果列表' }),
|
||||
}, { description: '翻译结果' });
|
||||
|
||||
type ReturnType = Static<typeof ReturnSchema>;
|
||||
|
||||
@ -29,6 +31,8 @@ export class TranslateEnWordToZn extends OneBotAction<PayloadType, ReturnType> {
|
||||
if (ret.result !== 0) {
|
||||
throw new Error('翻译失败');
|
||||
}
|
||||
return ret.words;
|
||||
return {
|
||||
words: ret.words
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,14 @@ export const ExtendsActionsExamples = {
|
||||
},
|
||||
GetAiCharacters: {
|
||||
payload: { group_id: '123456' },
|
||||
response: { characters: [] },
|
||||
response: [
|
||||
{
|
||||
type: 'string',
|
||||
characters: [
|
||||
{ character_id: 'id', character_name: 'name', preview_url: 'url' }
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
GetClientkey: {
|
||||
payload: {},
|
||||
@ -13,11 +20,11 @@ export const ExtendsActionsExamples = {
|
||||
},
|
||||
SetQQAvatar: {
|
||||
payload: { file: 'base64://...' },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
SetGroupKickMembers: {
|
||||
payload: { group_id: '123456', user_id: ['123456789'], reject_add_request: false },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
TranslateEnWordToZn: {
|
||||
payload: { words: ['hello'] },
|
||||
@ -29,10 +36,10 @@ export const ExtendsActionsExamples = {
|
||||
},
|
||||
SetLongNick: {
|
||||
payload: { longNick: '个性签名' },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
SetSpecialTitle: {
|
||||
payload: { group_id: '123456', user_id: '123456789', special_title: '头衔' },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
};
|
||||
|
||||
@ -57,7 +57,7 @@ export const GoCQHTTPActionsExamples = {
|
||||
},
|
||||
GetOnlineClient: {
|
||||
payload: { no_cache: false },
|
||||
response: { clients: [] },
|
||||
response: [],
|
||||
},
|
||||
GoCQHTTPCheckUrlSafely: {
|
||||
payload: { url: 'https://example.com' },
|
||||
@ -85,7 +85,7 @@ export const GoCQHTTPActionsExamples = {
|
||||
},
|
||||
SetGroupPortrait: {
|
||||
payload: { group_id: '123456', file: 'base64://...' },
|
||||
response: {},
|
||||
response: { result: 0, errMsg: '' },
|
||||
},
|
||||
SetQQProfile: {
|
||||
payload: { nickname: '新昵称', personal_note: '个性签名' },
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
export const GroupActionsExamples = {
|
||||
DelEssenceMsg: {
|
||||
payload: { message_id: 123456 },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
DelGroupNotice: {
|
||||
payload: { group_id: '123456', notice_id: 'notice_123' },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
GetGroupDetailInfo: {
|
||||
payload: { group_id: '123456' },
|
||||
@ -41,38 +41,38 @@ export const GroupActionsExamples = {
|
||||
},
|
||||
SetEssenceMsg: {
|
||||
payload: { message_id: 123456 },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
SetGroupAddRequest: {
|
||||
payload: { flag: 'flag_123', sub_type: 'add', approve: true },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
SetGroupAdmin: {
|
||||
payload: { group_id: '123456', user_id: '123456789', enable: true },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
SetGroupBan: {
|
||||
payload: { group_id: '123456', user_id: '123456789', duration: 1800 },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
SetGroupCard: {
|
||||
payload: { group_id: '123456', user_id: '123456789', card: '新名片' },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
SetGroupKick: {
|
||||
payload: { group_id: '123456', user_id: '123456789', reject_add_request: false },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
SetGroupLeave: {
|
||||
payload: { group_id: '123456', is_dismiss: false },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
SetGroupName: {
|
||||
payload: { group_id: '123456', group_name: '新群名' },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
SetGroupWholeBan: {
|
||||
payload: { group_id: '123456', enable: true },
|
||||
response: {},
|
||||
response: null,
|
||||
},
|
||||
};
|
||||
|
||||
@ -23,7 +23,7 @@ class DeleteMsg extends OneBotAction<PayloadType, ReturnType> {
|
||||
override payloadExample = {
|
||||
message_id: 12345
|
||||
};
|
||||
override returnExample = {};
|
||||
override returnExample = null;
|
||||
|
||||
async _handle (payload: PayloadType) {
|
||||
const msg = MessageUnique.getMsgIdAndPeerByShortId(Number(payload.message_id));
|
||||
|
||||
@ -24,7 +24,7 @@ class ForwardSingleMsg extends OneBotAction<PayloadType, ReturnType> {
|
||||
message_id: 12345,
|
||||
group_id: '123456'
|
||||
};
|
||||
override returnExample = {};
|
||||
override returnExample = null;
|
||||
|
||||
protected async getTargetPeer (payload: PayloadType): Promise<Peer> {
|
||||
if (payload.user_id) {
|
||||
|
||||
@ -23,7 +23,7 @@ class MarkMsgAsRead extends OneBotAction<PayloadType, ReturnType> {
|
||||
override payloadExample = {
|
||||
message_id: 12345
|
||||
};
|
||||
override returnExample = {};
|
||||
override returnExample = null;
|
||||
|
||||
async getPeer (payload: PayloadType): Promise<Peer> {
|
||||
if (payload.message_id) {
|
||||
@ -86,7 +86,7 @@ export class MarkAllMsgAsRead extends OneBotAction<void, null> {
|
||||
override actionSummary = '标记所有消息已读';
|
||||
override actionTags = ['消息接口'];
|
||||
override payloadExample = {};
|
||||
override returnExample = {};
|
||||
override returnExample = null;
|
||||
|
||||
async _handle (): Promise<null> {
|
||||
await this.core.apis.MsgApi.markAllMsgAsRead();
|
||||
|
||||
@ -22,7 +22,7 @@ export default class SetFriendRemark extends OneBotAction<SetFriendRemarkPayload
|
||||
user_id: '123456',
|
||||
remark: '测试备注'
|
||||
};
|
||||
override returnExample = {};
|
||||
override returnExample = null;
|
||||
override errorExamples = [
|
||||
...ActionExamples.Common.errors,
|
||||
{ code: 1400, description: '备注设置失败(好友不存在或非法输入)' }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user