feat(onebot): backfill semantic roles across action params
Phase 1 of the debug-console expansion. Sweeps the 8 action files, swapping bare coercion primitives for the role-stamped equivalents from Phase 0 (or appending `.role()` where a `.default()`/`.optional()` field must keep its exact coercion). Coercion is byte-for-byte unchanged; the only intentional bound change is face_id min 1→0 (QQ face 0 is valid). Classification (verified against each run()): - group_id → f.groupId() everywhere. - user_id → f.userId() for any-user / friend / stranger / private-route targets (send_private, friend poke, friend add/remove, stranger info, private file transfer, forward-to-friend, share-contact). - user_id → f.memberId() only when it's a member of a sibling group_id (batch kick elements; the groupUserAction preset already injects it). - media file/image/record + file_id → f.file()/image()/record()/fileId() (or .role() when defaulted/optional); message_id/timestamp/duration via the constructor or .role() hatch as coercion requires. Polymorphic ids left as bare uint on purpose (no single role can honestly describe them): mark_msg_as_read.target_id (group# or uin), bot_appid, msg_seq, fileset_id, folder_id, chunk indices, stream_id. Catalog regenerated: 71 group_id / 25 user_id / 9 member_id / 19 message_id / 11 file_id / 7 image / 6 file roles surfaced. Done by 4 parallel agents; adversarially reviewed — zero coercion regressions, zero member/user misclassifications.
This commit is contained in:
10 files changed
+551
-259
No files matched your search
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -141,7 +141,7 @@ export const actions = [
|
||||
name: 'send_like',
|
||||
summary: '点赞',
|
||||
params: {
|
||||
user_id: f.uint(),
|
||||
user_id: f.userId(),
|
||||
// 原实现用 `asNumber(times) || 1`,present 0 会被当作缺省 1。
|
||||
times: f.int({ min: 0 }).default(1),
|
||||
},
|
||||
@@ -155,8 +155,8 @@ export const actions = [
|
||||
name: 'friend_poke',
|
||||
summary: '好友拍一拍',
|
||||
params: {
|
||||
user_id: f.uint(),
|
||||
target_id: f.uint().optional(),
|
||||
user_id: f.userId(),
|
||||
target_id: f.userId().optional(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
await ctx.bridge.apis.interaction.sendPoke(false, p.user_id, p.target_id);
|
||||
@@ -177,8 +177,8 @@ export const actions = [
|
||||
name: 'send_poke',
|
||||
summary: '拍一拍(群聊/私聊自动路由)',
|
||||
params: {
|
||||
user_id: f.uint(),
|
||||
group_id: f.uint().optional(),
|
||||
user_id: f.userId(),
|
||||
group_id: f.groupId().optional(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
if (p.group_id) {
|
||||
@@ -233,7 +233,7 @@ export const actions = [
|
||||
name: 'set_group_reaction',
|
||||
summary: '群聊表情回应',
|
||||
params: {
|
||||
group_id: f.uint().optional(),
|
||||
group_id: f.groupId().optional(),
|
||||
message_id: f.messageId(),
|
||||
code: f.string({ allowEmpty: false }),
|
||||
is_set: f.bool().default(true),
|
||||
@@ -272,7 +272,7 @@ export const actions = [
|
||||
defineAction({
|
||||
name: 'add_custom_face',
|
||||
summary: '添加收藏表情',
|
||||
params: { file: f.string({ allowEmpty: false }) },
|
||||
params: { file: f.image() },
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
const emojiId = await ctx.bridge.apis.profile.addCustomFace(p.file);
|
||||
@@ -339,7 +339,7 @@ export const actions = [
|
||||
// param-validation time (retcode 1400) before run() ever fires. Use a
|
||||
// plain signed int; `.default(0)` keeps absent/present-0 → "fetch latest"
|
||||
// (matches the original `asNumber(message_id) || 0`). `count` stays ≥0.
|
||||
message_id: f.int().default(0),
|
||||
message_id: f.int().default(0).role('message_id'),
|
||||
count: f.int({ min: 0 }).default(20),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
@@ -361,9 +361,9 @@ export const actions = [
|
||||
required: ['messages'],
|
||||
},
|
||||
params: {
|
||||
user_id: f.uint(),
|
||||
user_id: f.userId(),
|
||||
// Signed int32 hash, frequently negative — see get_group_msg_history.
|
||||
message_id: f.int().default(0),
|
||||
message_id: f.int().default(0).role('message_id'),
|
||||
count: f.int({ min: 0 }).default(20),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
@@ -378,7 +378,7 @@ export const actions = [
|
||||
summary: '标记群消息已读',
|
||||
params: {
|
||||
message_id: f.messageId(),
|
||||
group_id: f.uint().optional(),
|
||||
group_id: f.groupId().optional(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
const meta = ctx.getMessageMeta(p.message_id);
|
||||
@@ -400,7 +400,7 @@ export const actions = [
|
||||
summary: '标记私聊消息已读',
|
||||
params: {
|
||||
message_id: f.messageId(),
|
||||
user_id: f.uint().optional(),
|
||||
user_id: f.userId().optional(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
const meta = ctx.getMessageMeta(p.message_id);
|
||||
@@ -447,7 +447,7 @@ export const actions = [
|
||||
summary: '发送群公告',
|
||||
params: {
|
||||
content: f.string({ allowEmpty: false }),
|
||||
image: f.string().default(''),
|
||||
image: f.string().default('').role('image'),
|
||||
pinned: f.raw(),
|
||||
type: f.raw(),
|
||||
confirm_required: f.raw(),
|
||||
@@ -490,7 +490,7 @@ export const actions = [
|
||||
params: {
|
||||
messages: f.message().optional(),
|
||||
message: f.message().optional(),
|
||||
group_id: f.uint().optional(),
|
||||
group_id: f.groupId().optional(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
const messages = p.messages ?? p.message;
|
||||
@@ -514,7 +514,7 @@ export const actions = [
|
||||
params: {
|
||||
messages: f.message().optional(),
|
||||
message: f.message().optional(),
|
||||
group_id: f.uint().optional(),
|
||||
group_id: f.groupId().optional(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
const messages = p.messages ?? p.message;
|
||||
@@ -531,8 +531,8 @@ export const actions = [
|
||||
summary: '获取图片信息',
|
||||
readOnly: true,
|
||||
params: {
|
||||
file: f.string().default(''),
|
||||
file_id: f.string().default(''),
|
||||
file: f.string().default('').role('image'),
|
||||
file_id: f.string().default('').role('file_id'),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
const file = p.file || p.file_id;
|
||||
@@ -548,8 +548,8 @@ export const actions = [
|
||||
summary: '获取语音信息',
|
||||
readOnly: true,
|
||||
params: {
|
||||
file: f.string().default(''),
|
||||
file_id: f.string().default(''),
|
||||
file: f.string().default('').role('record'),
|
||||
file_id: f.string().default('').role('file_id'),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
const file = p.file || p.file_id;
|
||||
@@ -574,7 +574,7 @@ export const actions = [
|
||||
required: ['text'],
|
||||
},
|
||||
params: {
|
||||
message_id: f.string().default(''),
|
||||
message_id: f.string().default('').role('message_id'),
|
||||
},
|
||||
// `raw` so message_id works whether the client sends a number or a string.
|
||||
run: async (_p, ctx, raw) => {
|
||||
@@ -684,7 +684,7 @@ export const actions = [
|
||||
name: 'set_friend_remark',
|
||||
summary: '设置好友备注',
|
||||
params: {
|
||||
user_id: f.uint(),
|
||||
user_id: f.userId(),
|
||||
remark: f.string(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
@@ -697,7 +697,7 @@ export const actions = [
|
||||
name: 'set_group_remark',
|
||||
summary: '设置群备注',
|
||||
params: {
|
||||
group_id: f.uint(),
|
||||
group_id: f.groupId(),
|
||||
remark: f.string(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
@@ -822,7 +822,7 @@ export const actions = [
|
||||
name: 'set_diy_online_status',
|
||||
summary: '设置自定义在线状态',
|
||||
params: {
|
||||
face_id: f.uint(),
|
||||
face_id: f.faceId(),
|
||||
// 原实现用 `asNumber(face_type) || 1`,present 0 会被当作缺省 1。
|
||||
face_type: f.int({ min: 0 }).default(1),
|
||||
wording: f.string().default(''),
|
||||
@@ -979,7 +979,7 @@ export const actions = [
|
||||
summary: '转发单条消息给好友',
|
||||
params: {
|
||||
message_id: f.messageId(),
|
||||
user_id: f.uint(),
|
||||
user_id: f.userId(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
@@ -996,7 +996,7 @@ export const actions = [
|
||||
summary: '转发单条消息到群',
|
||||
params: {
|
||||
message_id: f.messageId(),
|
||||
group_id: f.uint(),
|
||||
group_id: f.groupId(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
@@ -1044,7 +1044,7 @@ export const actions = [
|
||||
},
|
||||
params: {
|
||||
// 原实现 user_id 经 asNumber,无校验(0 也透传)。
|
||||
user_id: f.int({ min: 0 }).default(0),
|
||||
user_id: f.int({ min: 0 }).default(0).role('user_id'),
|
||||
start: f.int({ min: 0 }).default(0),
|
||||
count: f.int({ min: 0 }).default(10),
|
||||
},
|
||||
@@ -1367,8 +1367,8 @@ export const actions = [
|
||||
required: ['arkMsg'],
|
||||
},
|
||||
params: {
|
||||
user_id: f.uint().optional(),
|
||||
group_id: f.uint().optional(),
|
||||
user_id: f.userId().optional(),
|
||||
group_id: f.groupId().optional(),
|
||||
phone_number: f.string().default(''),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
@@ -1398,8 +1398,8 @@ export const actions = [
|
||||
required: ['arkMsg'],
|
||||
},
|
||||
params: {
|
||||
user_id: f.uint().optional(),
|
||||
group_id: f.uint().optional(),
|
||||
user_id: f.userId().optional(),
|
||||
group_id: f.groupId().optional(),
|
||||
phone_number: f.string().default(''),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
@@ -1427,7 +1427,7 @@ export const actions = [
|
||||
readOnly: true,
|
||||
returns: '服务端生成的群推荐 Ark 卡片 JSON 字符串。',
|
||||
returnsSchema: { type: 'string', description: '群 Ark 卡片 JSON 字符串' },
|
||||
params: { group_id: f.uint() },
|
||||
params: { group_id: f.groupId() },
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
return okResponse(await ctx.bridge.apis.contacts.getGroupRecommendArk(p.group_id));
|
||||
@@ -1442,7 +1442,7 @@ export const actions = [
|
||||
readOnly: true,
|
||||
returns: '服务端生成的群推荐 Ark 卡片 JSON 字符串。',
|
||||
returnsSchema: { type: 'string', description: '群 Ark 卡片 JSON 字符串' },
|
||||
params: { group_id: f.uint() },
|
||||
params: { group_id: f.groupId() },
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
return okResponse(await ctx.bridge.apis.contacts.getGroupRecommendArk(p.group_id));
|
||||
@@ -1565,7 +1565,7 @@ export const actions = [
|
||||
defineAction({
|
||||
name: 'set_qq_avatar',
|
||||
summary: '设置 QQ 头像',
|
||||
params: { file: f.string({ allowEmpty: false }) },
|
||||
params: { file: f.image() },
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
await ctx.bridge.apis.profile.setAvatar(p.file);
|
||||
@@ -1580,7 +1580,7 @@ export const actions = [
|
||||
name: 'set_input_status',
|
||||
summary: '设置输入状态',
|
||||
params: {
|
||||
user_id: f.uint(),
|
||||
user_id: f.userId(),
|
||||
// event_type 可能为 0(取消输入状态);缺省也按 0 处理(与旧 asNumber 行为一致)。
|
||||
event_type: f.int().default(0),
|
||||
},
|
||||
@@ -1598,7 +1598,7 @@ export const actions = [
|
||||
name: 'get_group_info_ex',
|
||||
summary: '获取群信息(扩展)',
|
||||
readOnly: true,
|
||||
params: { group_id: f.uint() },
|
||||
params: { group_id: f.groupId() },
|
||||
run: async (p, ctx) => {
|
||||
if (ctx.getGroupInfo) {
|
||||
return okResponse(await ctx.getGroupInfo(p.group_id));
|
||||
@@ -1611,7 +1611,7 @@ export const actions = [
|
||||
name: 'get_group_detail_info',
|
||||
summary: '获取群详细信息',
|
||||
readOnly: true,
|
||||
params: { group_id: f.uint() },
|
||||
params: { group_id: f.groupId() },
|
||||
run: async (p, ctx) => {
|
||||
if (ctx.getGroupInfo) {
|
||||
return okResponse(await ctx.getGroupInfo(p.group_id));
|
||||
@@ -1644,8 +1644,8 @@ export const actions = [
|
||||
summary: '获取文件信息(仅图片/语音缓存;群文件请用 get_group_file_url)',
|
||||
readOnly: true,
|
||||
params: {
|
||||
file_id: f.string().default(''),
|
||||
file: f.string().default(''),
|
||||
file_id: f.string().default('').role('file_id'),
|
||||
file: f.string().default('').role('file'),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
const fileId = p.file || p.file_id;
|
||||
@@ -1712,7 +1712,7 @@ export const actions = [
|
||||
},
|
||||
required: ['status', 'ext_status'],
|
||||
},
|
||||
params: { user_id: f.uint() },
|
||||
params: { user_id: f.userId() },
|
||||
run: async (p, ctx) => {
|
||||
const status = await ctx.bridge.apis.extras.getStrangerStatus(p.user_id);
|
||||
if (!status) return failedResponse(RETCODE.ACTION_FAILED, 'failed to fetch user status');
|
||||
@@ -1934,7 +1934,7 @@ export const actions = [
|
||||
},
|
||||
required: ['texts', 'language'],
|
||||
},
|
||||
params: { image: f.string({ allowEmpty: false }) },
|
||||
params: { image: f.image() },
|
||||
run: async (p, ctx) => {
|
||||
// A passed-in http(s) URL is used verbatim (NOT re-signed) — if it is a
|
||||
// stale CDN URL with an expired rkey the server fetch fails and surfaces
|
||||
@@ -2022,7 +2022,7 @@ export const actions = [
|
||||
name: 'send_private_forward_msg',
|
||||
summary: '发送私聊合并转发',
|
||||
returns: '{ message_id, res_id, forward_id }',
|
||||
params: { user_id: f.uint(), messages: f.message().optional(), message: f.message().optional() },
|
||||
params: { user_id: f.userId(), messages: f.message().optional(), message: f.message().optional() },
|
||||
run: async (p, ctx, raw) => {
|
||||
const messages = p.messages ?? p.message;
|
||||
if (messages === undefined) return failedResponse(RETCODE.BAD_REQUEST, 'message/messages is required');
|
||||
@@ -2407,8 +2407,8 @@ export const actions = [
|
||||
returns: '{ message_id }',
|
||||
params: {
|
||||
fileset_id: f.string({ allowEmpty: false }),
|
||||
user_id: f.uint().optional(),
|
||||
group_id: f.uint().optional(),
|
||||
user_id: f.userId().optional(),
|
||||
group_id: f.groupId().optional(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
if (!p.user_id && !p.group_id) {
|
||||
|
||||
@@ -46,7 +46,7 @@ export const actions = [
|
||||
},
|
||||
required: ['user_id', 'nickname', 'sex', 'age'],
|
||||
},
|
||||
params: { user_id: f.uint().describe('QQ 号') },
|
||||
params: { user_id: f.userId().describe('QQ 号') },
|
||||
run: async (p, ctx) => {
|
||||
const userId = p.user_id;
|
||||
if (ctx.getStrangerInfo) {
|
||||
@@ -60,7 +60,7 @@ export const actions = [
|
||||
defineAction({
|
||||
name: 'delete_friend',
|
||||
summary: '删除好友',
|
||||
params: { user_id: f.uint().describe('QQ 号'), block: f.bool().default(false) },
|
||||
params: { user_id: f.userId().describe('QQ 号'), block: f.bool().default(false) },
|
||||
run: async (p, ctx) => {
|
||||
await ctx.bridge.apis.friend.delete(p.user_id, p.block);
|
||||
return okResponse();
|
||||
|
||||
@@ -16,7 +16,7 @@ export const actions = [
|
||||
groupAction({
|
||||
name: 'set_group_kick_members',
|
||||
summary: '批量踢出群成员',
|
||||
params: { user_id: f.array(f.uint()).nonEmpty(), reject_add_request: f.bool().default(false) },
|
||||
params: { user_id: f.array(f.memberId()).nonEmpty(), reject_add_request: f.bool().default(false) },
|
||||
run: async (p, ctx) => {
|
||||
await ctx.bridge.apis.groupAdmin.kickMembers(p.group_id, p.user_id, p.reject_add_request);
|
||||
return okResponse();
|
||||
@@ -26,7 +26,7 @@ export const actions = [
|
||||
groupUserAction({
|
||||
name: 'set_group_ban',
|
||||
summary: '禁言群成员(duration=0 解除)',
|
||||
params: { duration: f.int({ min: 0 }).default(1800) },
|
||||
params: { duration: f.duration().default(1800) },
|
||||
run: async (p, ctx) => {
|
||||
await ctx.bridge.apis.groupAdmin.muteMember(p.group_id, p.user_id, p.duration);
|
||||
return okResponse();
|
||||
@@ -118,7 +118,7 @@ export const actions = [
|
||||
groupAction({
|
||||
name: 'set_group_portrait',
|
||||
summary: '设置群头像',
|
||||
params: { file: f.string({ allowEmpty: false }) },
|
||||
params: { file: f.image() },
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
await ctx.bridge.apis.profile.setGroupAvatar(p.group_id, p.file);
|
||||
|
||||
@@ -91,7 +91,7 @@ export const actions = [
|
||||
params: {
|
||||
album_id: f.string({ allowEmpty: false }),
|
||||
album_name: f.string({ allowEmpty: false }),
|
||||
file: f.string({ allowEmpty: false }),
|
||||
file: f.image(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
|
||||
@@ -26,7 +26,7 @@ export const actions = [
|
||||
// non-empty wins, else '/'. Both default '' so the `||` chain matches the
|
||||
// legacy `asString(folder) || asString(folder_id) || '/'`.
|
||||
params: {
|
||||
file: f.string({ allowEmpty: false }),
|
||||
file: f.file(),
|
||||
name: f.string().default(''),
|
||||
folder: f.string().default(''),
|
||||
folder_id: f.string().default(''),
|
||||
@@ -44,8 +44,8 @@ export const actions = [
|
||||
summary: '上传私聊文件',
|
||||
returns: '{ file_id: string }',
|
||||
params: {
|
||||
user_id: f.uint(),
|
||||
file: f.string({ allowEmpty: false }),
|
||||
user_id: f.userId(),
|
||||
file: f.file(),
|
||||
name: f.string().default(''),
|
||||
upload_file: f.bool().default(true),
|
||||
},
|
||||
@@ -67,7 +67,7 @@ export const actions = [
|
||||
},
|
||||
// busid is accepted but tolerant (see busidOr102): NapCat/LLBot ignore it,
|
||||
// so a present null/empty/non-numeric value must not 400 the request (#147).
|
||||
params: { file_id: f.string({ allowEmpty: false }), busid: f.raw() },
|
||||
params: { file_id: f.fileId(), busid: f.raw() },
|
||||
run: async (p, ctx) => {
|
||||
return okResponse({ url: await ctx.bridge.apis.groupFile.getUrl(p.group_id, p.file_id, busidOr102(p.busid)) });
|
||||
},
|
||||
@@ -183,7 +183,7 @@ export const actions = [
|
||||
groupAction({
|
||||
name: 'delete_group_file',
|
||||
summary: '删除群文件',
|
||||
params: { file_id: f.string({ allowEmpty: false }) },
|
||||
params: { file_id: f.fileId() },
|
||||
run: async (p, ctx) => {
|
||||
await ctx.bridge.apis.groupFile.delete(p.group_id, p.file_id);
|
||||
return okResponse();
|
||||
@@ -194,7 +194,7 @@ export const actions = [
|
||||
name: 'move_group_file',
|
||||
summary: '移动群文件',
|
||||
params: {
|
||||
file_id: f.string({ allowEmpty: false }),
|
||||
file_id: f.fileId(),
|
||||
parent_directory: f.string({ allowEmpty: false }),
|
||||
target_directory: f.string({ allowEmpty: false }),
|
||||
},
|
||||
@@ -210,7 +210,7 @@ export const actions = [
|
||||
name: 'rename_group_file',
|
||||
summary: '重命名群文件',
|
||||
params: {
|
||||
file_id: f.string({ allowEmpty: false }),
|
||||
file_id: f.fileId(),
|
||||
current_parent_directory: f.string().default('/'),
|
||||
new_name: f.string({ allowEmpty: false }),
|
||||
},
|
||||
@@ -276,8 +276,8 @@ export const actions = [
|
||||
// clients that only persist file_id, both user_id and file_hash are now
|
||||
// optional; file_hash falls through empty when absent. See issue #147.
|
||||
params: {
|
||||
user_id: f.uint().optional(),
|
||||
file_id: f.string({ allowEmpty: false }),
|
||||
user_id: f.userId().optional(),
|
||||
file_id: f.fileId(),
|
||||
file_hash: f.string().default(''),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
|
||||
@@ -47,8 +47,8 @@ export const actions = [
|
||||
params: {
|
||||
message: f.message(),
|
||||
message_type: f.string().optional(),
|
||||
group_id: f.uint().optional(),
|
||||
user_id: f.uint().optional(),
|
||||
group_id: f.groupId().optional(),
|
||||
user_id: f.userId().optional(),
|
||||
auto_escape: f.bool().default(false),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
@@ -67,7 +67,7 @@ export const actions = [
|
||||
name: 'send_private_msg',
|
||||
summary: '发送私聊消息',
|
||||
returns: '{ message_id: number }',
|
||||
params: { user_id: f.uint(), message: f.message(), auto_escape: f.bool().default(false) },
|
||||
params: { user_id: f.userId(), message: f.message(), auto_escape: f.bool().default(false) },
|
||||
run: async (p, ctx) => {
|
||||
const result = await ctx.sendPrivateMessage(p.user_id, p.message, p.auto_escape);
|
||||
return okResponse({ message_id: result.messageId });
|
||||
|
||||
@@ -54,7 +54,7 @@ export const actions = [
|
||||
},
|
||||
summary: '获取 QQ 空间说说列表(默认机器人自己的空间)',
|
||||
params: {
|
||||
target_uin: f.uint().describe('目标 QQ 号,省略则取机器人自己').optional(),
|
||||
target_uin: f.userId().describe('目标 QQ 号,省略则取机器人自己').optional(),
|
||||
pos: f.int({ min: 0 }).describe('起始偏移').default(0),
|
||||
num: f.int({ min: 1, max: 100 }).describe('本页数量').default(20),
|
||||
},
|
||||
@@ -167,8 +167,8 @@ export const actions = [
|
||||
summary: '给一条说说点赞(QQ 空间)',
|
||||
params: {
|
||||
tid: f.string({ allowEmpty: false }).describe('说说 tid'),
|
||||
target_uin: f.uint().describe('说说所属 QQ 号,省略则为机器人自己').optional(),
|
||||
abstime: f.int({ min: 0 }).describe('说说发表时间(unix 秒),传真实值更可靠').default(0),
|
||||
target_uin: f.userId().describe('说说所属 QQ 号,省略则为机器人自己').optional(),
|
||||
abstime: f.int({ min: 0 }).describe('说说发表时间(unix 秒),传真实值更可靠').default(0).role('timestamp'),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
@@ -188,8 +188,8 @@ export const actions = [
|
||||
summary: '取消对一条说说的点赞(QQ 空间;取消赞端点待真机核实)',
|
||||
params: {
|
||||
tid: f.string({ allowEmpty: false }).describe('说说 tid'),
|
||||
target_uin: f.uint().describe('说说所属 QQ 号,省略则为机器人自己').optional(),
|
||||
abstime: f.int({ min: 0 }).describe('说说发表时间(unix 秒),传真实值更可靠').default(0),
|
||||
target_uin: f.userId().describe('说说所属 QQ 号,省略则为机器人自己').optional(),
|
||||
abstime: f.int({ min: 0 }).describe('说说发表时间(unix 秒),传真实值更可靠').default(0).role('timestamp'),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
@@ -211,7 +211,7 @@ export const actions = [
|
||||
params: {
|
||||
tid: f.string({ allowEmpty: false }).describe('说说 tid'),
|
||||
content: f.string({ allowEmpty: false }).describe('评论内容'),
|
||||
target_uin: f.uint().describe('说说所属 QQ 号,省略则为机器人自己').optional(),
|
||||
target_uin: f.userId().describe('说说所属 QQ 号,省略则为机器人自己').optional(),
|
||||
images: f.array(f.string({ allowEmpty: false })).describe('图片数组(可选),支持 file:// http:// base64://;自动上传').optional(),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
|
||||
@@ -325,8 +325,8 @@ async function runDownload(
|
||||
// ─────────────────────────── action definitions ───────────────────────────
|
||||
|
||||
const downloadParams = {
|
||||
file: f.string().optional().describe('文件路径(限 stream 临时目录)/ http(s) URL'),
|
||||
file_id: f.string().optional().describe('文件 ID(缓存的图片/语音 id)'),
|
||||
file: f.string().optional().describe('文件路径(限 stream 临时目录)/ http(s) URL').role('file'),
|
||||
file_id: f.string().optional().describe('文件 ID(缓存的图片/语音 id)').role('file_id'),
|
||||
chunk_size: f.int({ min: 1 }).optional().describe('分块大小(字节,默认 64KB)'),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user