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
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user