@zhin.js/adapter-qq 1.1.17 → 1.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/README.md +75 -21
- package/adapters/qq/index.js +4 -33
- package/adapters/qq/index.ts +3 -41
- package/agents/qq/boundaries.md +2 -0
- package/agents/qq/conversation.js +92 -0
- package/agents/qq/conversation.ts +99 -0
- package/agents/qq/messages.js +60 -0
- package/agents/qq/messages.ts +60 -0
- package/agents/qq/skills/qq/SKILL.md +8 -2
- package/agents/qq/skills/qq/tools/add_role/index.js +2 -1
- package/agents/qq/skills/qq/tools/add_role/index.ts +2 -1
- package/agents/qq/skills/qq/tools/channel_info/index.js +1 -1
- package/agents/qq/skills/qq/tools/channel_info/index.ts +1 -1
- package/agents/qq/skills/qq/tools/create_role/index.js +1 -1
- package/agents/qq/skills/qq/tools/create_role/index.ts +1 -1
- package/agents/qq/skills/qq/tools/guild_kick_member/index.js +30 -0
- package/agents/qq/skills/qq/tools/guild_kick_member/index.ts +29 -0
- package/agents/qq/skills/qq/tools/guild_mute_member/index.js +31 -0
- package/agents/qq/skills/qq/tools/guild_mute_member/index.ts +30 -0
- package/agents/qq/skills/qq/tools/list_channels/index.js +1 -1
- package/agents/qq/skills/qq/tools/list_channels/index.ts +1 -1
- package/agents/qq/skills/qq/tools/list_roles/index.js +1 -1
- package/agents/qq/skills/qq/tools/list_roles/index.ts +1 -1
- package/agents/qq/skills/qq/tools/member_detail/index.js +1 -1
- package/agents/qq/skills/qq/tools/member_detail/index.ts +1 -1
- package/agents/qq/skills/qq/tools/remove_role/index.js +2 -1
- package/agents/qq/skills/qq/tools/remove_role/index.ts +2 -1
- package/agents/qq/skills/qq-conversation/SKILL.md +24 -0
- package/agents/qq/skills/qq-conversation/tools/conversation_info/index.js +78 -0
- package/agents/qq/skills/qq-conversation/tools/conversation_info/index.ts +76 -0
- package/agents/qq/skills/qq-directory/tools/list_guilds/index.js +1 -1
- package/agents/qq/skills/qq-directory/tools/list_guilds/index.ts +1 -1
- package/agents/qq/skills/qq-group-admin/SKILL.md +34 -0
- package/agents/qq/skills/qq-group-admin/tools/group_kick/index.js +39 -0
- package/agents/qq/skills/qq-group-admin/tools/group_kick/index.ts +38 -0
- package/agents/qq/skills/qq-group-admin/tools/handle_join_request/index.js +33 -0
- package/agents/qq/skills/qq-group-admin/tools/handle_join_request/index.ts +32 -0
- package/agents/qq/skills/qq-group-admin/tools/recall_member_message/index.js +25 -0
- package/agents/qq/skills/qq-group-admin/tools/recall_member_message/index.ts +25 -0
- package/agents/qq/skills/qq-group-admin/tools/set_mute/index.js +37 -0
- package/agents/qq/skills/qq-group-admin/tools/set_mute/index.ts +36 -0
- package/agents/qq/skills/qq-group-directory/SKILL.md +24 -0
- package/agents/qq/skills/qq-group-directory/tools/group_info/index.js +16 -0
- package/agents/qq/skills/qq-group-directory/tools/group_info/index.ts +16 -0
- package/agents/qq/skills/qq-group-directory/tools/group_member_info/index.js +19 -0
- package/agents/qq/skills/qq-group-directory/tools/group_member_info/index.ts +19 -0
- package/agents/qq/skills/qq-group-directory/tools/group_members/index.js +19 -0
- package/agents/qq/skills/qq-group-directory/tools/group_members/index.ts +19 -0
- package/agents/qq/skills/qq-group-state/SKILL.md +21 -0
- package/agents/qq/skills/qq-group-state/tools/group_blacklist/index.js +19 -0
- package/agents/qq/skills/qq-group-state/tools/group_blacklist/index.ts +19 -0
- package/agents/qq/skills/qq-group-state/tools/list_join_requests/index.js +19 -0
- package/agents/qq/skills/qq-group-state/tools/list_join_requests/index.ts +19 -0
- package/agents/qq/skills/qq-group-state/tools/list_muted/index.js +21 -0
- package/agents/qq/skills/qq-group-state/tools/list_muted/index.ts +21 -0
- package/agents/qq/skills/qq-messages/SKILL.md +27 -0
- package/agents/qq/skills/qq-messages/tools/quote_reply/index.js +21 -0
- package/agents/qq/skills/qq-messages/tools/quote_reply/index.ts +21 -0
- package/agents/qq/skills/qq-messages/tools/recall_own_message/index.js +18 -0
- package/agents/qq/skills/qq-messages/tools/recall_own_message/index.ts +17 -0
- package/commands/qq/endpoint/definition.js +73 -55
- package/commands/qq/endpoint/definition.ts +75 -86
- package/lib/adapter.d.ts +13 -0
- package/lib/adapter.js +27 -0
- package/lib/client.d.ts +7 -9
- package/lib/client.js +1 -2
- package/lib/console.d.ts +3 -0
- package/lib/console.js +93 -0
- package/lib/endpoint.d.ts +17 -27
- package/lib/endpoint.js +325 -146
- package/lib/group-admin.d.ts +41 -0
- package/lib/group-admin.js +114 -0
- package/lib/i18n.js +4 -4
- package/lib/image-size.d.ts +6 -1
- package/lib/image-size.js +2 -3
- package/lib/index.d.ts +5 -4
- package/lib/index.js +3 -3
- package/lib/interaction.js +1 -1
- package/lib/outbound.d.ts +4 -1
- package/lib/outbound.js +3 -2
- package/lib/protocol.d.ts +7 -0
- package/lib/protocol.js +4 -0
- package/lib/qq-console-spec.d.ts +17 -0
- package/lib/qq-console-spec.js +21 -0
- package/lib/qq-console.d.ts +10 -0
- package/lib/qq-console.js +126 -0
- package/lib/qq-endpoint-write.d.ts +18 -0
- package/lib/qq-endpoint-write.js +7 -0
- package/lib/qq-runtime-state.d.ts +29 -9
- package/lib/qq-runtime-state.js +5 -5
- package/lib/qq-send.d.ts +7 -14
- package/lib/qq-send.js +20 -6
- package/lib/webhook.d.ts +3 -6
- package/lib/webhook.js +6 -49
- package/lib/ws.d.ts +10 -33
- package/lib/ws.js +21 -70
- package/middlewares/bot-kind-reply/index.js +1 -2
- package/middlewares/bot-kind-reply/index.ts +0 -2
- package/package.json +26 -18
- package/pages/index/index.js +15 -0
- package/pages/index/index.ts +16 -0
- package/plugin.js +9 -6
- package/schema.json +174 -0
- package/src/adapter.ts +23 -0
- package/src/client.ts +4 -12
- package/src/console.ts +103 -0
- package/src/endpoint.ts +328 -141
- package/src/group-admin.ts +155 -0
- package/src/i18n.ts +4 -4
- package/src/image-size.ts +7 -3
- package/src/index.ts +5 -5
- package/src/interaction.ts +1 -1
- package/src/outbound.ts +3 -2
- package/src/protocol.ts +10 -0
- package/src/qq-console-spec.ts +29 -0
- package/src/qq-console.ts +130 -0
- package/src/qq-endpoint-write.ts +24 -0
- package/src/qq-runtime-state.ts +31 -15
- package/src/qq-send.ts +28 -12
- package/src/webhook.ts +7 -57
- package/src/ws.ts +27 -105
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { currentGroup, kickQqGroupMember, requireGroupManager } from '../../../../conversation.js';
|
|
4
|
+
import { messages as t } from '../../../../messages.js';
|
|
5
|
+
|
|
6
|
+
export default defineAgentTool({
|
|
7
|
+
description: '把当前 QQ 群中的普通成员移出群,可选同时拉黑;每次人工审批,官方白名单能力',
|
|
8
|
+
adapter: 'qq',
|
|
9
|
+
scopes: ['group'],
|
|
10
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
11
|
+
requiresApproval: 'human',
|
|
12
|
+
risk: 'dangerous',
|
|
13
|
+
riskCategory: 'member',
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
user_id: z.string().min(1).describe('要移出的成员 member_openid'),
|
|
16
|
+
reason: z.string().min(1).describe('本次移出的具体原因,随目标成员一起供人工确认'),
|
|
17
|
+
blacklist: z.boolean().default(false).describe('是否同时加入群黑名单'),
|
|
18
|
+
}),
|
|
19
|
+
async execute({ user_id, blacklist }, context) {
|
|
20
|
+
const group = currentGroup(context);
|
|
21
|
+
const client = context.$client;
|
|
22
|
+
const [self, member] = await Promise.all([
|
|
23
|
+
requireGroupManager(context, group),
|
|
24
|
+
client.groupService.getMemberInfo(group, user_id),
|
|
25
|
+
]);
|
|
26
|
+
if (!self) return { success: false, message: t(context.locale, 'botNotManager') };
|
|
27
|
+
if (member.member_openid !== user_id || member.member_role !== 'member' || member.bot || user_id === self.member_openid) {
|
|
28
|
+
return { success: false, message: t(context.locale, 'targetNotMember') };
|
|
29
|
+
}
|
|
30
|
+
context.signal.throwIfAborted();
|
|
31
|
+
const { blacklistFailed } = await kickQqGroupMember(client, { groupId: group, userId: user_id, addToBlacklist: blacklist === true });
|
|
32
|
+
return {
|
|
33
|
+
success: true,
|
|
34
|
+
message: t(context.locale, 'memberKicked', { p0: member.username || user_id }),
|
|
35
|
+
...(blacklistFailed ? { warning: t(context.locale, 'blacklistFailed') } : {}),
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { currentGroup, requireGroupManager } from '../../../../conversation.js';
|
|
5
|
+
import { messages as t } from '../../../../messages.js';
|
|
6
|
+
export default defineAgentTool({
|
|
7
|
+
description: '通过或拒绝当前 QQ 群的一条入群申请;每次人工审批,需机器人为群管理员,官方白名单能力',
|
|
8
|
+
adapter: 'qq',
|
|
9
|
+
scopes: ['group'],
|
|
10
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
11
|
+
requiresApproval: 'human',
|
|
12
|
+
risk: 'dangerous',
|
|
13
|
+
riskCategory: 'member',
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
user_id: z.string().min(1).describe('申请人 member_openid(来自 list_join_requests 或入群申请事件)'),
|
|
16
|
+
join_request_id: z.string().min(1).optional().describe('申请 ID(list_join_requests 返回的 join_request_id)'),
|
|
17
|
+
approve: z.boolean().describe('true 通过,false 拒绝'),
|
|
18
|
+
reason: z.string().optional().describe('拒绝理由(仅拒绝时发送)'),
|
|
19
|
+
blacklist: z.boolean().default(false).describe('拒绝时是否同时拉黑'),
|
|
20
|
+
}),
|
|
21
|
+
async execute({ user_id, join_request_id, approve, reason, blacklist }, context) {
|
|
22
|
+
const group = currentGroup(context);
|
|
23
|
+
if (!await requireGroupManager(context, group))
|
|
24
|
+
return { success: false, message: t(context.locale, 'botNotManager') };
|
|
25
|
+
await context.$client.groupService.approveJoinRequest(group, user_id, {
|
|
26
|
+
op: approve ? 'approve' : 'decline',
|
|
27
|
+
...(join_request_id ? { join_request_id } : {}),
|
|
28
|
+
...(!approve && reason ? { reject_reason: reason } : {}),
|
|
29
|
+
...(!approve && blacklist ? { add_to_member_blacklist: true } : {}),
|
|
30
|
+
});
|
|
31
|
+
return { success: true, message: t(context.locale, approve ? 'joinApproved' : 'joinDeclined', { user: user_id }) };
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { currentGroup, requireGroupManager } from '../../../../conversation.js';
|
|
4
|
+
import { messages as t } from '../../../../messages.js';
|
|
5
|
+
|
|
6
|
+
export default defineAgentTool({
|
|
7
|
+
description: '通过或拒绝当前 QQ 群的一条入群申请;每次人工审批,需机器人为群管理员,官方白名单能力',
|
|
8
|
+
adapter: 'qq',
|
|
9
|
+
scopes: ['group'],
|
|
10
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
11
|
+
requiresApproval: 'human',
|
|
12
|
+
risk: 'dangerous',
|
|
13
|
+
riskCategory: 'member',
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
user_id: z.string().min(1).describe('申请人 member_openid(来自 list_join_requests 或入群申请事件)'),
|
|
16
|
+
join_request_id: z.string().min(1).optional().describe('申请 ID(list_join_requests 返回的 join_request_id)'),
|
|
17
|
+
approve: z.boolean().describe('true 通过,false 拒绝'),
|
|
18
|
+
reason: z.string().optional().describe('拒绝理由(仅拒绝时发送)'),
|
|
19
|
+
blacklist: z.boolean().default(false).describe('拒绝时是否同时拉黑'),
|
|
20
|
+
}),
|
|
21
|
+
async execute({ user_id, join_request_id, approve, reason, blacklist }, context) {
|
|
22
|
+
const group = currentGroup(context);
|
|
23
|
+
if (!await requireGroupManager(context, group)) return { success: false, message: t(context.locale, 'botNotManager') };
|
|
24
|
+
await context.$client.groupService.approveJoinRequest(group, user_id, {
|
|
25
|
+
op: approve ? 'approve' : 'decline',
|
|
26
|
+
...(join_request_id ? { join_request_id } : {}),
|
|
27
|
+
...(!approve && reason ? { reject_reason: reason } : {}),
|
|
28
|
+
...(!approve && blacklist ? { add_to_member_blacklist: true } : {}),
|
|
29
|
+
});
|
|
30
|
+
return { success: true, message: t(context.locale, approve ? 'joinApproved' : 'joinDeclined', { user: user_id }) };
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { currentConversation, recallTarget, requireGroupManager, resolveMessageTarget } from '../../../../conversation.js';
|
|
5
|
+
import { messages as t } from '../../../../messages.js';
|
|
6
|
+
export default defineAgentTool({
|
|
7
|
+
description: '撤回当前 QQ 群或频道子频道内他人的真实消息;需调用方具备群管发起权限,机器人须为管理员,官方只允许 2 分钟内',
|
|
8
|
+
adapter: 'qq',
|
|
9
|
+
scopes: ['group', 'channel'],
|
|
10
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
11
|
+
requiresApproval: 'never',
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
message_id: z.string().min(1).describe('当前会话中要撤回的真实消息 ID,或消息头里的 m<n> 别名'),
|
|
14
|
+
reason: z.string().min(1).describe('撤回的具体原因,自动处理必须依据已确认的群规'),
|
|
15
|
+
}),
|
|
16
|
+
async execute({ message_id }, context) {
|
|
17
|
+
const conversation = currentConversation(context);
|
|
18
|
+
const target = resolveMessageTarget(context, message_id);
|
|
19
|
+
// 自己的消息不依赖管理员身份。群里再实时核验机器人角色;目标角色(只能撤回普通成员)由平台执行。
|
|
20
|
+
if (!target.ownOutbound && conversation.kind === 'group' && !await requireGroupManager(context, conversation.id)) {
|
|
21
|
+
return { success: false, message: t(context.locale, 'botNotManager') };
|
|
22
|
+
}
|
|
23
|
+
return recallTarget(context, target);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { currentConversation, recallTarget, requireGroupManager, resolveMessageTarget } from '../../../../conversation.js';
|
|
4
|
+
import { messages as t } from '../../../../messages.js';
|
|
5
|
+
|
|
6
|
+
export default defineAgentTool({
|
|
7
|
+
description: '撤回当前 QQ 群或频道子频道内他人的真实消息;需调用方具备群管发起权限,机器人须为管理员,官方只允许 2 分钟内',
|
|
8
|
+
adapter: 'qq',
|
|
9
|
+
scopes: ['group', 'channel'],
|
|
10
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
11
|
+
requiresApproval: 'never',
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
message_id: z.string().min(1).describe('当前会话中要撤回的真实消息 ID,或消息头里的 m<n> 别名'),
|
|
14
|
+
reason: z.string().min(1).describe('撤回的具体原因,自动处理必须依据已确认的群规'),
|
|
15
|
+
}),
|
|
16
|
+
async execute({ message_id }, context) {
|
|
17
|
+
const conversation = currentConversation(context);
|
|
18
|
+
const target = resolveMessageTarget(context, message_id);
|
|
19
|
+
// 自己的消息不依赖管理员身份。群里再实时核验机器人角色;目标角色(只能撤回普通成员)由平台执行。
|
|
20
|
+
if (!target.ownOutbound && conversation.kind === 'group' && !await requireGroupManager(context, conversation.id)) {
|
|
21
|
+
return { success: false, message: t(context.locale, 'botNotManager') };
|
|
22
|
+
}
|
|
23
|
+
return recallTarget(context, target);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { currentGroup, muteQqGroupMember, QQ_GROUP_MUTE_MAX_SECONDS, requireGroupManager } from '../../../../conversation.js';
|
|
5
|
+
import { messages as t } from '../../../../messages.js';
|
|
6
|
+
export default defineAgentTool({
|
|
7
|
+
description: '禁言 / 解除禁言当前 QQ 群中的普通成员(最长 30 天);需机器人为群管理员',
|
|
8
|
+
adapter: 'qq',
|
|
9
|
+
scopes: ['group'],
|
|
10
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
11
|
+
requiresApproval: 'always',
|
|
12
|
+
risk: 'dangerous',
|
|
13
|
+
riskCategory: 'member',
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
user_id: z.string().min(1).describe('目标成员 member_openid'),
|
|
16
|
+
duration: z.number().int().min(0).max(QQ_GROUP_MUTE_MAX_SECONDS).default(0).describe('禁言秒数,0 = 解除禁言,最长 2592000(30 天)'),
|
|
17
|
+
}),
|
|
18
|
+
async execute({ user_id, duration }, context) {
|
|
19
|
+
const group = currentGroup(context);
|
|
20
|
+
const client = context.$client;
|
|
21
|
+
const seconds = duration ?? 0;
|
|
22
|
+
const [self, member] = await Promise.all([
|
|
23
|
+
requireGroupManager(context, group),
|
|
24
|
+
client.groupService.getMemberInfo(group, user_id),
|
|
25
|
+
]);
|
|
26
|
+
if (!self)
|
|
27
|
+
return { success: false, message: t(context.locale, 'botNotManager') };
|
|
28
|
+
// 官方:新增 / 更新禁言只能作用于普通成员;解除不限制。
|
|
29
|
+
if (member.member_openid !== user_id || (seconds > 0 && (member.member_role !== 'member' || member.bot))) {
|
|
30
|
+
return { success: false, message: t(context.locale, 'targetNotMember') };
|
|
31
|
+
}
|
|
32
|
+
context.signal.throwIfAborted();
|
|
33
|
+
await muteQqGroupMember(client, { groupId: group, userId: user_id, durationSeconds: seconds });
|
|
34
|
+
const user = member.username || user_id;
|
|
35
|
+
return { success: true, message: seconds === 0 ? t(context.locale, 'unmuted', { user }) : t(context.locale, 'muted', { user, seconds }) };
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { currentGroup, muteQqGroupMember, QQ_GROUP_MUTE_MAX_SECONDS, requireGroupManager } from '../../../../conversation.js';
|
|
4
|
+
import { messages as t } from '../../../../messages.js';
|
|
5
|
+
|
|
6
|
+
export default defineAgentTool({
|
|
7
|
+
description: '禁言 / 解除禁言当前 QQ 群中的普通成员(最长 30 天);需机器人为群管理员',
|
|
8
|
+
adapter: 'qq',
|
|
9
|
+
scopes: ['group'],
|
|
10
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
11
|
+
requiresApproval: 'always',
|
|
12
|
+
risk: 'dangerous',
|
|
13
|
+
riskCategory: 'member',
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
user_id: z.string().min(1).describe('目标成员 member_openid'),
|
|
16
|
+
duration: z.number().int().min(0).max(QQ_GROUP_MUTE_MAX_SECONDS).default(0).describe('禁言秒数,0 = 解除禁言,最长 2592000(30 天)'),
|
|
17
|
+
}),
|
|
18
|
+
async execute({ user_id, duration }, context) {
|
|
19
|
+
const group = currentGroup(context);
|
|
20
|
+
const client = context.$client;
|
|
21
|
+
const seconds = duration ?? 0;
|
|
22
|
+
const [self, member] = await Promise.all([
|
|
23
|
+
requireGroupManager(context, group),
|
|
24
|
+
client.groupService.getMemberInfo(group, user_id),
|
|
25
|
+
]);
|
|
26
|
+
if (!self) return { success: false, message: t(context.locale, 'botNotManager') };
|
|
27
|
+
// 官方:新增 / 更新禁言只能作用于普通成员;解除不限制。
|
|
28
|
+
if (member.member_openid !== user_id || (seconds > 0 && (member.member_role !== 'member' || member.bot))) {
|
|
29
|
+
return { success: false, message: t(context.locale, 'targetNotMember') };
|
|
30
|
+
}
|
|
31
|
+
context.signal.throwIfAborted();
|
|
32
|
+
await muteQqGroupMember(client, { groupId: group, userId: user_id, durationSeconds: seconds });
|
|
33
|
+
const user = member.username || user_id;
|
|
34
|
+
return { success: true, message: seconds === 0 ? t(context.locale, 'unmuted', { user }) : t(context.locale, 'muted', { user, seconds }) };
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qq-group-directory
|
|
3
|
+
platforms:
|
|
4
|
+
- qq
|
|
5
|
+
description: 当前 QQ 群的群信息、成员列表与成员详情(官方白名单能力)。
|
|
6
|
+
keywords:
|
|
7
|
+
- 群信息
|
|
8
|
+
- 群成员
|
|
9
|
+
- 成员列表
|
|
10
|
+
- member_openid
|
|
11
|
+
tools:
|
|
12
|
+
- group_info
|
|
13
|
+
- group_members
|
|
14
|
+
- group_member_info
|
|
15
|
+
scopes:
|
|
16
|
+
- group
|
|
17
|
+
---
|
|
18
|
+
# qq-group-directory
|
|
19
|
+
|
|
20
|
+
All lookups target the current group only. Members are identified by `member_openid`, which is scoped to this bot and group; never derive it from a nickname or reuse it in another group.
|
|
21
|
+
|
|
22
|
+
Member list and member detail are invite-only official capabilities. Error 11253 means the bot has no access; report that instead of guessing. `group_members` is paged (≤30 per page, 60 QPM): request further pages only when needed.
|
|
23
|
+
|
|
24
|
+
There is no official API for the bot's group list, friend list or arbitrary user profiles, so `group_list`, `friend_list` and `user_info` do not exist on QQ official bots.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '获取当前 QQ 群的基本信息(群名、简介、分类、标签、人数)',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
requiresApproval: 'never',
|
|
10
|
+
readOnly: true,
|
|
11
|
+
inputSchema: z.object({}),
|
|
12
|
+
async execute(_input, context) {
|
|
13
|
+
const info = await context.$client.groupService.getInfo(currentGroup(context));
|
|
14
|
+
return { success: true, group: info };
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
4
|
+
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '获取当前 QQ 群的基本信息(群名、简介、分类、标签、人数)',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
requiresApproval: 'never',
|
|
10
|
+
readOnly: true,
|
|
11
|
+
inputSchema: z.object({}),
|
|
12
|
+
async execute(_input, context) {
|
|
13
|
+
const info = await context.$client.groupService.getInfo(currentGroup(context));
|
|
14
|
+
return { success: true, group: info };
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '获取当前 QQ 群中指定成员的信息(昵称、角色、是否机器人、入群时间);官方白名单能力',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
10
|
+
requiresApproval: 'never',
|
|
11
|
+
readOnly: true,
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
user_id: z.string().min(1).describe('目标成员的 member_openid(来自消息发送者或成员列表,不要猜测)'),
|
|
14
|
+
}),
|
|
15
|
+
async execute({ user_id }, context) {
|
|
16
|
+
const member = await context.$client.groupService.getMemberInfo(currentGroup(context), user_id);
|
|
17
|
+
return { success: true, member };
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
4
|
+
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '获取当前 QQ 群中指定成员的信息(昵称、角色、是否机器人、入群时间);官方白名单能力',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
10
|
+
requiresApproval: 'never',
|
|
11
|
+
readOnly: true,
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
user_id: z.string().min(1).describe('目标成员的 member_openid(来自消息发送者或成员列表,不要猜测)'),
|
|
14
|
+
}),
|
|
15
|
+
async execute({ user_id }, context) {
|
|
16
|
+
const member = await context.$client.groupService.getMemberInfo(currentGroup(context), user_id);
|
|
17
|
+
return { success: true, member };
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '分页列出当前 QQ 群成员(每页最多 30 人,含 member_openid、昵称、角色);官方白名单能力',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
10
|
+
requiresApproval: 'never',
|
|
11
|
+
readOnly: true,
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
cursor: z.string().optional().describe('上一页返回的 next_cursor;首次不传'),
|
|
14
|
+
}),
|
|
15
|
+
async execute({ cursor }, context) {
|
|
16
|
+
const page = await context.$client.groupService.getMembersPage(currentGroup(context), cursor ? { cursor } : {});
|
|
17
|
+
return { success: true, members: page.members ?? [], count: page.members?.length ?? 0, next_cursor: page.next_cursor || undefined };
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
4
|
+
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '分页列出当前 QQ 群成员(每页最多 30 人,含 member_openid、昵称、角色);官方白名单能力',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
10
|
+
requiresApproval: 'never',
|
|
11
|
+
readOnly: true,
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
cursor: z.string().optional().describe('上一页返回的 next_cursor;首次不传'),
|
|
14
|
+
}),
|
|
15
|
+
async execute({ cursor }, context) {
|
|
16
|
+
const page = await context.$client.groupService.getMembersPage(currentGroup(context), cursor ? { cursor } : {});
|
|
17
|
+
return { success: true, members: page.members ?? [], count: page.members?.length ?? 0, next_cursor: page.next_cursor || undefined };
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qq-group-state
|
|
3
|
+
platforms:
|
|
4
|
+
- qq
|
|
5
|
+
description: 当前 QQ 群的禁言状态、待处理入群申请与黑名单查询。
|
|
6
|
+
keywords:
|
|
7
|
+
- 禁言列表
|
|
8
|
+
- 入群申请
|
|
9
|
+
- 黑名单
|
|
10
|
+
tools:
|
|
11
|
+
- list_muted
|
|
12
|
+
- list_join_requests
|
|
13
|
+
- group_blacklist
|
|
14
|
+
scopes:
|
|
15
|
+
- group
|
|
16
|
+
---
|
|
17
|
+
# qq-group-state
|
|
18
|
+
|
|
19
|
+
Read-only views of the current group. `list_muted` returns the global mute rule and members whose mute has not expired. `list_join_requests` and `group_blacklist` are paged invite-only APIs; error 11253 means the bot has no access.
|
|
20
|
+
|
|
21
|
+
Act on a join request with `qq-group-admin` → `handle_join_request`, after confirming the applicant. Group files are not exposed by the official API.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '分页查询当前 QQ 群的成员黑名单;官方白名单能力',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
10
|
+
requiresApproval: 'never',
|
|
11
|
+
readOnly: true,
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
cursor: z.string().optional().describe('上一页返回的 next_cursor;首次不传'),
|
|
14
|
+
}),
|
|
15
|
+
async execute({ cursor }, context) {
|
|
16
|
+
const page = await context.$client.groupService.getMemberBlacklist(currentGroup(context), cursor ? { cursor } : {});
|
|
17
|
+
return { users: page.users ?? [], count: page.users?.length ?? 0, next_cursor: page.next_cursor || undefined };
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
4
|
+
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '分页查询当前 QQ 群的成员黑名单;官方白名单能力',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
10
|
+
requiresApproval: 'never',
|
|
11
|
+
readOnly: true,
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
cursor: z.string().optional().describe('上一页返回的 next_cursor;首次不传'),
|
|
14
|
+
}),
|
|
15
|
+
async execute({ cursor }, context) {
|
|
16
|
+
const page = await context.$client.groupService.getMemberBlacklist(currentGroup(context), cursor ? { cursor } : {});
|
|
17
|
+
return { users: page.users ?? [], count: page.users?.length ?? 0, next_cursor: page.next_cursor || undefined };
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '分页列出当前 QQ 群待处理的入群申请(含验证信息、风险提示);官方白名单能力',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
10
|
+
requiresApproval: 'never',
|
|
11
|
+
readOnly: true,
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
cursor: z.string().optional().describe('上一页返回的 next_cursor;首次不传'),
|
|
14
|
+
}),
|
|
15
|
+
async execute({ cursor }, context) {
|
|
16
|
+
const page = await context.$client.groupService.getJoinRequests(currentGroup(context), cursor ? { cursor } : {});
|
|
17
|
+
return { requests: page.list ?? [], count: page.list?.length ?? 0, next_cursor: page.next_cursor || undefined };
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
4
|
+
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '分页列出当前 QQ 群待处理的入群申请(含验证信息、风险提示);官方白名单能力',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
10
|
+
requiresApproval: 'never',
|
|
11
|
+
readOnly: true,
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
cursor: z.string().optional().describe('上一页返回的 next_cursor;首次不传'),
|
|
14
|
+
}),
|
|
15
|
+
async execute({ cursor }, context) {
|
|
16
|
+
const page = await context.$client.groupService.getJoinRequests(currentGroup(context), cursor ? { cursor } : {});
|
|
17
|
+
return { requests: page.list ?? [], count: page.list?.length ?? 0, next_cursor: page.next_cursor || undefined };
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '查询当前 QQ 群的禁言状态:全员禁言规则与被禁言成员列表',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
requiresApproval: 'never',
|
|
10
|
+
readOnly: true,
|
|
11
|
+
inputSchema: z.object({}),
|
|
12
|
+
async execute(_input, context) {
|
|
13
|
+
const setting = await context.$client.groupService.getMuteSetting(currentGroup(context));
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
const muted = (setting.members ?? []).filter((m) => {
|
|
16
|
+
const until = Date.parse(m.mute_expire_at);
|
|
17
|
+
return !Number.isFinite(until) || until > now;
|
|
18
|
+
});
|
|
19
|
+
return { global_rule: setting.global_rule, muted_members: muted, count: muted.length };
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { currentGroup } from '../../../../conversation.js';
|
|
4
|
+
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '查询当前 QQ 群的禁言状态:全员禁言规则与被禁言成员列表',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['group'],
|
|
9
|
+
requiresApproval: 'never',
|
|
10
|
+
readOnly: true,
|
|
11
|
+
inputSchema: z.object({}),
|
|
12
|
+
async execute(_input, context) {
|
|
13
|
+
const setting = await context.$client.groupService.getMuteSetting(currentGroup(context));
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
const muted = (setting.members ?? []).filter((m) => {
|
|
16
|
+
const until = Date.parse(m.mute_expire_at);
|
|
17
|
+
return !Number.isFinite(until) || until > now;
|
|
18
|
+
});
|
|
19
|
+
return { global_rule: setting.global_rule, muted_members: muted, count: muted.length };
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qq-messages
|
|
3
|
+
platforms:
|
|
4
|
+
- qq
|
|
5
|
+
description: QQ 官方机器人当前会话的引用回复,以及撤回机器人自己的发言。
|
|
6
|
+
keywords:
|
|
7
|
+
- 引用
|
|
8
|
+
- 回复原消息
|
|
9
|
+
- 撤回
|
|
10
|
+
- 自己的消息
|
|
11
|
+
tools:
|
|
12
|
+
- quote_reply
|
|
13
|
+
- recall_own_message
|
|
14
|
+
scopes:
|
|
15
|
+
- private
|
|
16
|
+
- group
|
|
17
|
+
- channel
|
|
18
|
+
---
|
|
19
|
+
# qq-messages
|
|
20
|
+
|
|
21
|
+
Only use real message IDs from the current conversation. Do not invent IDs or source authors. Both tools stay inside the current conversation; cross-conversation forwarding does not exist on the official API.
|
|
22
|
+
|
|
23
|
+
`quote_reply` sends a text reply that references one original (passive reply `msg_id` / guild `message_reference`) through the unified outbound pipeline. Use `inspect_conversation_reference` to read an incoming quote when available; it does not send messages.
|
|
24
|
+
|
|
25
|
+
`recall_own_message` accepts only the bot's own send receipt ID and needs no management role or approval. QQ only recalls messages younger than 2 minutes; never promise success before confirmation or retry an unconfirmed result. To recall another member's message, load `qq-group-admin`.
|
|
26
|
+
|
|
27
|
+
Merged forward (`forward_messages`) is not available: the official API cannot send merged-forward records.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { resolveMessageTarget, sendToConversation } from '../../../../conversation.js';
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '引用当前 QQ 会话中的真实消息并回复文字(引用即被动回复的 msg_id / message_reference);发送走统一链路',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['private', 'group', 'channel'],
|
|
9
|
+
requiresApproval: 'never',
|
|
10
|
+
inputSchema: z.object({
|
|
11
|
+
message_id: z.string().min(1).describe('当前会话中真实的原消息 ID,或消息头里的 m<n> 别名'),
|
|
12
|
+
text: z.string().min(1).describe('本次回复的文字'),
|
|
13
|
+
}),
|
|
14
|
+
async execute({ message_id, text }, context) {
|
|
15
|
+
const target = resolveMessageTarget(context, message_id);
|
|
16
|
+
return sendToConversation(context, [
|
|
17
|
+
{ type: 'reply', data: { message_id: target.messageId } },
|
|
18
|
+
{ type: 'text', data: { text } },
|
|
19
|
+
]);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { resolveMessageTarget, sendToConversation } from '../../../../conversation.js';
|
|
4
|
+
|
|
5
|
+
export default defineAgentTool({
|
|
6
|
+
description: '引用当前 QQ 会话中的真实消息并回复文字(引用即被动回复的 msg_id / message_reference);发送走统一链路',
|
|
7
|
+
adapter: 'qq',
|
|
8
|
+
scopes: ['private', 'group', 'channel'],
|
|
9
|
+
requiresApproval: 'never',
|
|
10
|
+
inputSchema: z.object({
|
|
11
|
+
message_id: z.string().min(1).describe('当前会话中真实的原消息 ID,或消息头里的 m<n> 别名'),
|
|
12
|
+
text: z.string().min(1).describe('本次回复的文字'),
|
|
13
|
+
}),
|
|
14
|
+
async execute({ message_id, text }, context) {
|
|
15
|
+
const target = resolveMessageTarget(context, message_id);
|
|
16
|
+
return sendToConversation(context, [
|
|
17
|
+
{ type: 'reply', data: { message_id: target.messageId } },
|
|
18
|
+
{ type: 'text', data: { text } },
|
|
19
|
+
]);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { recallTarget, resolveMessageTarget } from '../../../../conversation.js';
|
|
5
|
+
import { messages as t } from '../../../../messages.js';
|
|
6
|
+
export default defineAgentTool({
|
|
7
|
+
description: '撤回机器人在当前 QQ 会话中自己发送的消息;无需群管角色或逐次审批,官方只允许撤回 2 分钟内的消息',
|
|
8
|
+
adapter: 'qq',
|
|
9
|
+
scopes: ['private', 'group', 'channel'],
|
|
10
|
+
requiresApproval: 'never',
|
|
11
|
+
inputSchema: z.object({ message_id: z.string().min(1).describe('机器人在当前会话中发送的消息 ID(发送回执),或消息头里的 m<n> 别名') }),
|
|
12
|
+
async execute({ message_id }, context) {
|
|
13
|
+
const target = resolveMessageTarget(context, message_id);
|
|
14
|
+
if (!target.ownOutbound)
|
|
15
|
+
return { success: false, message: t(context.locale, 'ownMessageRequired') };
|
|
16
|
+
return recallTarget(context, target);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { recallTarget, resolveMessageTarget } from '../../../../conversation.js';
|
|
4
|
+
import { messages as t } from '../../../../messages.js';
|
|
5
|
+
|
|
6
|
+
export default defineAgentTool({
|
|
7
|
+
description: '撤回机器人在当前 QQ 会话中自己发送的消息;无需群管角色或逐次审批,官方只允许撤回 2 分钟内的消息',
|
|
8
|
+
adapter: 'qq',
|
|
9
|
+
scopes: ['private', 'group', 'channel'],
|
|
10
|
+
requiresApproval: 'never',
|
|
11
|
+
inputSchema: z.object({ message_id: z.string().min(1).describe('机器人在当前会话中发送的消息 ID(发送回执),或消息头里的 m<n> 别名') }),
|
|
12
|
+
async execute({ message_id }, context) {
|
|
13
|
+
const target = resolveMessageTarget(context, message_id);
|
|
14
|
+
if (!target.ownOutbound) return { success: false, message: t(context.locale, 'ownMessageRequired') };
|
|
15
|
+
return recallTarget(context, target);
|
|
16
|
+
},
|
|
17
|
+
});
|