feat(onebot): backfill returnsSchema on remaining read-only actions (c2: source-proven only)
This commit is contained in:
6 files changed
+612
-5
No files matched your search
@@ -7,6 +7,19 @@ export const actions = [
|
||||
name: 'get_friend_list',
|
||||
summary: '获取好友列表',
|
||||
readOnly: true,
|
||||
returns: '好友列表数组,每项含 QQ 号、昵称与备注。',
|
||||
returnsSchema: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
user_id: { type: 'integer', description: '好友 QQ 号' },
|
||||
nickname: { type: 'string', description: '好友昵称' },
|
||||
remark: { type: 'string', description: '好友备注' },
|
||||
},
|
||||
required: ['user_id', 'nickname', 'remark'],
|
||||
},
|
||||
},
|
||||
params: {},
|
||||
run: async (_p, ctx) => {
|
||||
if (ctx.getFriendList) {
|
||||
@@ -20,6 +33,19 @@ export const actions = [
|
||||
name: 'get_stranger_info',
|
||||
summary: '获取陌生人信息',
|
||||
readOnly: true,
|
||||
returns: '陌生人资料:QQ 号、昵称、性别、年龄,命中资料时另含等级。',
|
||||
returnsSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
user_id: { type: 'integer', description: 'QQ 号' },
|
||||
nickname: { type: 'string', description: '昵称' },
|
||||
sex: { type: 'string', description: '性别(male/female/unknown)' },
|
||||
age: { type: 'integer', description: '年龄' },
|
||||
qq_level: { type: 'integer', description: 'QQ 等级(仅查到资料时返回)' },
|
||||
level: { type: 'integer', description: 'QQ 等级,同 qq_level(仅查到资料时返回)' },
|
||||
},
|
||||
required: ['user_id', 'nickname', 'sex', 'age'],
|
||||
},
|
||||
params: { user_id: f.uint().describe('QQ 号') },
|
||||
run: async (p, ctx) => {
|
||||
const userId = p.user_id;
|
||||
|
||||
Reference in new issue
Block a user