@zhin.js/adapter-discord 1.1.14 → 1.1.16
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 +58 -0
- package/agents/discord/messages.js +48 -0
- package/agents/discord/messages.ts +48 -0
- package/agents/discord/skills/discord/SKILL.md +11 -13
- package/agents/discord/skills/discord/tools/react/index.js +3 -2
- package/agents/discord/skills/discord/tools/react/index.ts +3 -2
- package/agents/discord/skills/discord/tools/send_embed/index.js +4 -3
- package/agents/discord/skills/discord/tools/send_embed/index.ts +4 -3
- package/agents/discord/skills/discord-guild/SKILL.md +22 -0
- package/agents/discord/skills/{discord → discord-guild}/tools/add_role/index.js +3 -1
- package/agents/discord/skills/{discord → discord-guild}/tools/add_role/index.ts +3 -1
- package/agents/discord/skills/{discord → discord-guild}/tools/create_thread/index.js +4 -2
- package/agents/discord/skills/{discord → discord-guild}/tools/create_thread/index.ts +4 -2
- package/agents/discord/skills/{discord → discord-guild}/tools/forum_post/index.js +4 -2
- package/agents/discord/skills/{discord → discord-guild}/tools/forum_post/index.ts +4 -2
- package/agents/discord/skills/{discord → discord-guild}/tools/list_roles/index.js +1 -0
- package/agents/discord/skills/{discord → discord-guild}/tools/list_roles/index.ts +1 -0
- package/agents/discord/skills/{discord → discord-guild}/tools/remove_role/index.js +3 -1
- package/agents/discord/skills/{discord → discord-guild}/tools/remove_role/index.ts +3 -1
- package/lib/webhook.d.ts +2 -0
- package/lib/webhook.js +8 -2
- package/package.json +17 -17
- package/schema.json +41 -6
- package/src/webhook.ts +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# @zhin.js/adapter-discord
|
|
2
2
|
|
|
3
|
+
## 1.1.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 53bc6a0: 适配器配置标签、端点命令和工具反馈支持中英文;复用当前操作语言,保持协议值、用户内容、身份、权限与发送链路不变。Sandbox 展示使用项目语言,QQ 绑定与交互状态保留完整会话身份。
|
|
8
|
+
- 9cade30: 修复国际化调用链遗漏:Agent 审批、管理命令和错误反馈采用可信语言及实际命令前缀;游戏快捷帮助、工具反馈、平台默认卡片和后台通知贯通语言。协议即时回复复用受运行代约束的个人语言查询,业务验证支持不改变审批身份的双语展示元数据。
|
|
9
|
+
|
|
10
|
+
AI 正文、进度与耗尽摘要统一优先遵从用户明确语言要求,再跟随实际输入;个人/项目语言仅作兜底,固定界面文案继续使用配置语言,不增加翻译调用。
|
|
11
|
+
|
|
12
|
+
GitHub 工作区为 Git clone/pull/fetch/ls-remote 显式分隔选项与位置参数,保留仓库和分支校验;顺序写入 Bot 名称和邮箱,避免竞争同一配置文件锁。
|
|
13
|
+
|
|
14
|
+
- dcd4982: Upgrade runtime dependencies to clear security advisories: `undici` (6.29.1 / 8.12.2+), `axios` 1.20.0, and `@modelcontextprotocol/sdk` 1.32.0+ (bringing patched `hono`, `body-parser`, `proxy-addr`, `follow-redirects` and `ip-address` through the lockfile).
|
|
15
|
+
- Updated dependencies [334e92d]
|
|
16
|
+
- Updated dependencies [f3b7c9f]
|
|
17
|
+
- Updated dependencies [658a5fb]
|
|
18
|
+
- Updated dependencies [144a17b]
|
|
19
|
+
- Updated dependencies [18296cf]
|
|
20
|
+
- Updated dependencies [08e64de]
|
|
21
|
+
- Updated dependencies [9cade30]
|
|
22
|
+
- Updated dependencies [53bc6a0]
|
|
23
|
+
- Updated dependencies [7595136]
|
|
24
|
+
- Updated dependencies [66b6404]
|
|
25
|
+
- Updated dependencies [adb4af2]
|
|
26
|
+
- Updated dependencies [69f9ef6]
|
|
27
|
+
- Updated dependencies [17d1301]
|
|
28
|
+
- @zhin.js/adapter@1.1.23
|
|
29
|
+
- @zhin.js/host-http@1.1.10
|
|
30
|
+
- @zhin.js/core@1.1.51
|
|
31
|
+
- @zhin.js/permission@1.1.9
|
|
32
|
+
- @zhin.js/tool@1.1.10
|
|
33
|
+
- @zhin.js/skill@1.1.10
|
|
34
|
+
- @zhin.js/im-contract@1.1.7
|
|
35
|
+
- @zhin.js/agent-feature@1.1.10
|
|
36
|
+
- @zhin.js/feature-kit@1.1.9
|
|
37
|
+
|
|
38
|
+
## 1.1.15
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- 7d68df6: 精简 Agent 内置固定提示词与消息说明,保留工具、审批和结构化回复能力。适配器 Skill 按会话场景拆分,群/频道管理仅向对应场景披露;提示段与模型消息段支持场景声明,沿用当前回合权限和 generation 投影。
|
|
43
|
+
- Updated dependencies [f98025b]
|
|
44
|
+
- Updated dependencies [66ec1a5]
|
|
45
|
+
- Updated dependencies [7d68df6]
|
|
46
|
+
- Updated dependencies [bf0fa9f]
|
|
47
|
+
- Updated dependencies [3326db3]
|
|
48
|
+
- Updated dependencies [e91235e]
|
|
49
|
+
- Updated dependencies [6da2bad]
|
|
50
|
+
- Updated dependencies [3781f1c]
|
|
51
|
+
- @zhin.js/core@1.1.50
|
|
52
|
+
- @zhin.js/adapter@1.1.22
|
|
53
|
+
- @zhin.js/im-contract@1.1.6
|
|
54
|
+
- @zhin.js/tool@1.1.9
|
|
55
|
+
- @zhin.js/host-http@1.1.9
|
|
56
|
+
- @zhin.js/agent-feature@1.1.9
|
|
57
|
+
- @zhin.js/feature-kit@1.1.8
|
|
58
|
+
- @zhin.js/permission@1.1.8
|
|
59
|
+
- @zhin.js/skill@1.1.9
|
|
60
|
+
|
|
3
61
|
## 1.1.14
|
|
4
62
|
|
|
5
63
|
### Patch Changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { createMessages } from 'zhin.js/i18n';
|
|
3
|
+
export const messages = createMessages({
|
|
4
|
+
"reactionAdded": {
|
|
5
|
+
"zh-CN": "已添加反应 {p0}",
|
|
6
|
+
"en": "Reaction added: {p0}"
|
|
7
|
+
},
|
|
8
|
+
"notTextChannel": {
|
|
9
|
+
"zh-CN": "Channel {p0} 不是文本频道",
|
|
10
|
+
"en": "Channel {p0} is not a text channel"
|
|
11
|
+
},
|
|
12
|
+
"embedSent": {
|
|
13
|
+
"zh-CN": "Embed 已发送",
|
|
14
|
+
"en": "Embed sent"
|
|
15
|
+
},
|
|
16
|
+
"invalidFields": {
|
|
17
|
+
"zh-CN": "fields 格式错误,应为 JSON 数组",
|
|
18
|
+
"en": "fields must be a JSON array"
|
|
19
|
+
},
|
|
20
|
+
"operationFailed": {
|
|
21
|
+
"zh-CN": "操作失败",
|
|
22
|
+
"en": "Operation failed"
|
|
23
|
+
},
|
|
24
|
+
"memberRoleAdded": {
|
|
25
|
+
"zh-CN": "已给用户 {p0} 添加角色",
|
|
26
|
+
"en": "Role added to user {p0}"
|
|
27
|
+
},
|
|
28
|
+
"threadCreated": {
|
|
29
|
+
"zh-CN": "帖子 \"{p0}\" 已创建",
|
|
30
|
+
"en": "Thread \"{p0}\" created"
|
|
31
|
+
},
|
|
32
|
+
"threadsUnsupported": {
|
|
33
|
+
"zh-CN": "Channel {p0} 不支持创建帖子",
|
|
34
|
+
"en": "Channel {p0} does not support creating threads"
|
|
35
|
+
},
|
|
36
|
+
"forumCreated": {
|
|
37
|
+
"zh-CN": "论坛帖 \"{p0}\" 已创建",
|
|
38
|
+
"en": "Forum post \"{p0}\" created"
|
|
39
|
+
},
|
|
40
|
+
"notForumChannel": {
|
|
41
|
+
"zh-CN": "Channel {p0} 不是论坛频道",
|
|
42
|
+
"en": "Channel {p0} is not a forum channel"
|
|
43
|
+
},
|
|
44
|
+
"memberRoleRemoved": {
|
|
45
|
+
"zh-CN": "已移除用户 {p0} 的角色",
|
|
46
|
+
"en": "Role removed from user {p0}"
|
|
47
|
+
}
|
|
48
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createMessages } from 'zhin.js/i18n';
|
|
2
|
+
|
|
3
|
+
export const messages = createMessages({
|
|
4
|
+
"reactionAdded": {
|
|
5
|
+
"zh-CN": "已添加反应 {p0}",
|
|
6
|
+
"en": "Reaction added: {p0}"
|
|
7
|
+
},
|
|
8
|
+
"notTextChannel": {
|
|
9
|
+
"zh-CN": "Channel {p0} 不是文本频道",
|
|
10
|
+
"en": "Channel {p0} is not a text channel"
|
|
11
|
+
},
|
|
12
|
+
"embedSent": {
|
|
13
|
+
"zh-CN": "Embed 已发送",
|
|
14
|
+
"en": "Embed sent"
|
|
15
|
+
},
|
|
16
|
+
"invalidFields": {
|
|
17
|
+
"zh-CN": "fields 格式错误,应为 JSON 数组",
|
|
18
|
+
"en": "fields must be a JSON array"
|
|
19
|
+
},
|
|
20
|
+
"operationFailed": {
|
|
21
|
+
"zh-CN": "操作失败",
|
|
22
|
+
"en": "Operation failed"
|
|
23
|
+
},
|
|
24
|
+
"memberRoleAdded": {
|
|
25
|
+
"zh-CN": "已给用户 {p0} 添加角色",
|
|
26
|
+
"en": "Role added to user {p0}"
|
|
27
|
+
},
|
|
28
|
+
"threadCreated": {
|
|
29
|
+
"zh-CN": "帖子 \"{p0}\" 已创建",
|
|
30
|
+
"en": "Thread \"{p0}\" created"
|
|
31
|
+
},
|
|
32
|
+
"threadsUnsupported": {
|
|
33
|
+
"zh-CN": "Channel {p0} 不支持创建帖子",
|
|
34
|
+
"en": "Channel {p0} does not support creating threads"
|
|
35
|
+
},
|
|
36
|
+
"forumCreated": {
|
|
37
|
+
"zh-CN": "论坛帖 \"{p0}\" 已创建",
|
|
38
|
+
"en": "Forum post \"{p0}\" created"
|
|
39
|
+
},
|
|
40
|
+
"notForumChannel": {
|
|
41
|
+
"zh-CN": "Channel {p0} 不是论坛频道",
|
|
42
|
+
"en": "Channel {p0} is not a forum channel"
|
|
43
|
+
},
|
|
44
|
+
"memberRoleRemoved": {
|
|
45
|
+
"zh-CN": "已移除用户 {p0} 的角色",
|
|
46
|
+
"en": "Role removed from user {p0}"
|
|
47
|
+
}
|
|
48
|
+
});
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: discord
|
|
3
|
-
platforms:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
platforms:
|
|
4
|
+
- discord
|
|
5
|
+
description: Discord 消息反应与 Embed。
|
|
6
|
+
keywords:
|
|
7
|
+
- discord
|
|
8
|
+
- reaction
|
|
9
|
+
- embed
|
|
10
|
+
tags:
|
|
11
|
+
- adapter
|
|
12
|
+
- community
|
|
7
13
|
tools:
|
|
8
|
-
- add_role
|
|
9
|
-
- remove_role
|
|
10
|
-
- list_roles
|
|
11
|
-
- create_thread
|
|
12
14
|
- react
|
|
13
15
|
- send_embed
|
|
14
|
-
- forum_post
|
|
15
16
|
---
|
|
16
|
-
|
|
17
17
|
# Discord
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
当前 Agent Tool 不提供踢人、封禁、禁言、改昵称或成员列表操作,不要声称已经执行这些动作。
|
|
19
|
+
用 react 回应消息,用 send_embed 发送结构化内容;使用真实消息和频道 ID。
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -15,10 +16,10 @@ export default defineAgentTool({
|
|
|
15
16
|
const client = requireDiscordGatewayClient(context.$client);
|
|
16
17
|
const channel = await client.channels.fetch(channel_id);
|
|
17
18
|
if (!channel?.isTextBased() || !channel.messages) {
|
|
18
|
-
throw new Error(
|
|
19
|
+
throw new Error(t(context.locale, 'notTextChannel', { p0: channel_id }));
|
|
19
20
|
}
|
|
20
21
|
const message = await channel.messages.fetch(message_id);
|
|
21
22
|
await message.react(emoji);
|
|
22
|
-
return { success: true, message:
|
|
23
|
+
return { success: true, message: t(context.locale, 'reactionAdded', { p0: emoji }) };
|
|
23
24
|
},
|
|
24
25
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -15,10 +16,10 @@ export default defineAgentTool<{ channel_id: string; message_id: string; emoji:
|
|
|
15
16
|
const client = requireDiscordGatewayClient(context.$client);
|
|
16
17
|
const channel = await client.channels.fetch(channel_id);
|
|
17
18
|
if (!channel?.isTextBased() || !channel.messages) {
|
|
18
|
-
throw new Error(
|
|
19
|
+
throw new Error(t(context.locale, 'notTextChannel', { p0: channel_id }));
|
|
19
20
|
}
|
|
20
21
|
const message = await channel.messages.fetch(message_id);
|
|
21
22
|
await message.react(emoji);
|
|
22
|
-
return { success: true, message:
|
|
23
|
+
return { success: true, message: t(context.locale, 'reactionAdded', { p0: emoji }) };
|
|
23
24
|
},
|
|
24
25
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -30,14 +31,14 @@ export default defineAgentTool({
|
|
|
30
31
|
embedData.fields = JSON.parse(fields);
|
|
31
32
|
}
|
|
32
33
|
catch {
|
|
33
|
-
return { success: false, message:
|
|
34
|
+
return { success: false, message: t(context.locale, 'invalidFields') };
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
const channel = await client.channels.fetch(channel_id);
|
|
37
38
|
if (!channel?.isTextBased() || !channel.send) {
|
|
38
|
-
throw new Error(
|
|
39
|
+
throw new Error(t(context.locale, 'notTextChannel', { p0: channel_id }));
|
|
39
40
|
}
|
|
40
41
|
const msg = await channel.send({ embeds: [embedData] });
|
|
41
|
-
return { success: true, message_id: msg.id, message:
|
|
42
|
+
return { success: true, message_id: msg.id, message: t(context.locale, 'embedSent') };
|
|
42
43
|
},
|
|
43
44
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -25,14 +26,14 @@ export default defineAgentTool<{ channel_id: string; title?: string; description
|
|
|
25
26
|
try {
|
|
26
27
|
embedData.fields = JSON.parse(fields);
|
|
27
28
|
} catch {
|
|
28
|
-
return { success: false, message:
|
|
29
|
+
return { success: false, message: t(context.locale, 'invalidFields') };
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
const channel = await client.channels.fetch(channel_id);
|
|
32
33
|
if (!channel?.isTextBased() || !channel.send) {
|
|
33
|
-
throw new Error(
|
|
34
|
+
throw new Error(t(context.locale, 'notTextChannel', { p0: channel_id }));
|
|
34
35
|
}
|
|
35
36
|
const msg = await channel.send({ embeds: [embedData] } as never);
|
|
36
|
-
return { success: true, message_id: msg.id, message:
|
|
37
|
+
return { success: true, message_id: msg.id, message: t(context.locale, 'embedSent') };
|
|
37
38
|
},
|
|
38
39
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: discord-guild
|
|
3
|
+
platforms:
|
|
4
|
+
- discord
|
|
5
|
+
scopes:
|
|
6
|
+
- channel
|
|
7
|
+
description: Discord 服务器角色、频道线程与论坛帖子。
|
|
8
|
+
keywords:
|
|
9
|
+
- discord
|
|
10
|
+
- role
|
|
11
|
+
- thread
|
|
12
|
+
- forum
|
|
13
|
+
tools:
|
|
14
|
+
- add_role
|
|
15
|
+
- remove_role
|
|
16
|
+
- list_roles
|
|
17
|
+
- create_thread
|
|
18
|
+
- forum_post
|
|
19
|
+
---
|
|
20
|
+
# discord-guild
|
|
21
|
+
|
|
22
|
+
角色修改前用 list_roles 确认角色 ID;线程和帖子使用当前频道上下文。遵守权限和审批。没有踢人、封禁、禁言、改昵称或成员列表工具,不要声称已执行这些动作。
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -11,6 +12,7 @@ export default defineAgentTool({
|
|
|
11
12
|
role_id: z.string().describe('角色 ID'),
|
|
12
13
|
}),
|
|
13
14
|
adapter: 'discord',
|
|
15
|
+
scopes: ["channel"],
|
|
14
16
|
tags: ['discord'],
|
|
15
17
|
permissions: [platformPermission('discord', 'manage_roles')],
|
|
16
18
|
async execute({ guild_id, user_id, role_id }, context) {
|
|
@@ -19,6 +21,6 @@ export default defineAgentTool({
|
|
|
19
21
|
const member = await guild.members.fetch(user_id);
|
|
20
22
|
await member.roles.add(role_id);
|
|
21
23
|
const success = true;
|
|
22
|
-
return { success, message: success ?
|
|
24
|
+
return { success, message: success ? t(context.locale, 'memberRoleAdded', { p0: user_id }) : t(context.locale, 'operationFailed') };
|
|
23
25
|
},
|
|
24
26
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -11,6 +12,7 @@ export default defineAgentTool<{ guild_id: string; user_id: string; role_id: str
|
|
|
11
12
|
role_id: z.string().describe('角色 ID'),
|
|
12
13
|
}),
|
|
13
14
|
adapter: 'discord',
|
|
15
|
+
scopes: ["channel"],
|
|
14
16
|
tags: ['discord'],
|
|
15
17
|
permissions: [platformPermission('discord', 'manage_roles')],
|
|
16
18
|
async execute({ guild_id, user_id, role_id }: { guild_id: string; user_id: string; role_id: string }, context) {
|
|
@@ -21,6 +23,6 @@ export default defineAgentTool<{ guild_id: string; user_id: string; role_id: str
|
|
|
21
23
|
};
|
|
22
24
|
await member.roles.add(role_id);
|
|
23
25
|
const success = true;
|
|
24
|
-
return { success, message: success ?
|
|
26
|
+
return { success, message: success ? t(context.locale, 'memberRoleAdded', { p0: user_id }) : t(context.locale, 'operationFailed') };
|
|
25
27
|
},
|
|
26
28
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -12,18 +13,19 @@ export default defineAgentTool({
|
|
|
12
13
|
auto_archive_duration: z.number().optional().describe('自动归档时间(分钟:60/1440/4320/10080)'),
|
|
13
14
|
}),
|
|
14
15
|
adapter: 'discord',
|
|
16
|
+
scopes: ["channel"],
|
|
15
17
|
tags: ['discord'],
|
|
16
18
|
permissions: [platformPermission('discord', 'manage_channels')],
|
|
17
19
|
async execute({ channel_id, name, message_id, auto_archive_duration }, context) {
|
|
18
20
|
const client = requireDiscordGatewayClient(context.$client);
|
|
19
21
|
const channel = await client.channels.fetch(channel_id);
|
|
20
22
|
if (!channel?.threads)
|
|
21
|
-
throw new Error(
|
|
23
|
+
throw new Error(t(context.locale, 'threadsUnsupported', { p0: channel_id }));
|
|
22
24
|
const thread = await channel.threads.create({
|
|
23
25
|
name,
|
|
24
26
|
autoArchiveDuration: auto_archive_duration || 1440,
|
|
25
27
|
...(message_id ? { startMessage: message_id } : {}),
|
|
26
28
|
});
|
|
27
|
-
return { success: true, thread_id: thread.id, message:
|
|
29
|
+
return { success: true, thread_id: thread.id, message: t(context.locale, 'threadCreated', { p0: name }) };
|
|
28
30
|
},
|
|
29
31
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -12,17 +13,18 @@ export default defineAgentTool<{ channel_id: string; name: string; message_id?:
|
|
|
12
13
|
auto_archive_duration: z.number().optional().describe('自动归档时间(分钟:60/1440/4320/10080)'),
|
|
13
14
|
}),
|
|
14
15
|
adapter: 'discord',
|
|
16
|
+
scopes: ["channel"],
|
|
15
17
|
tags: ['discord'],
|
|
16
18
|
permissions: [platformPermission('discord', 'manage_channels')],
|
|
17
19
|
async execute({ channel_id, name, message_id, auto_archive_duration }: { channel_id: string; name: string; message_id?: string; auto_archive_duration?: number }, context) {
|
|
18
20
|
const client = requireDiscordGatewayClient(context.$client);
|
|
19
21
|
const channel = await client.channels.fetch(channel_id);
|
|
20
|
-
if (!channel?.threads) throw new Error(
|
|
22
|
+
if (!channel?.threads) throw new Error(t(context.locale, 'threadsUnsupported', { p0: channel_id }));
|
|
21
23
|
const thread = await channel.threads.create({
|
|
22
24
|
name,
|
|
23
25
|
autoArchiveDuration: auto_archive_duration || 1440,
|
|
24
26
|
...(message_id ? { startMessage: message_id } : {}),
|
|
25
27
|
});
|
|
26
|
-
return { success: true, thread_id: thread.id, message:
|
|
28
|
+
return { success: true, thread_id: thread.id, message: t(context.locale, 'threadCreated', { p0: name }) };
|
|
27
29
|
},
|
|
28
30
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -12,13 +13,14 @@ export default defineAgentTool({
|
|
|
12
13
|
tags: z.string().optional().describe('标签名,逗号分隔(可选)'),
|
|
13
14
|
}),
|
|
14
15
|
adapter: 'discord',
|
|
16
|
+
scopes: ["channel"],
|
|
15
17
|
tags: ['discord'],
|
|
16
18
|
async execute({ channel_id, name, content, tags }, context) {
|
|
17
19
|
const client = requireDiscordGatewayClient(context.$client);
|
|
18
20
|
const tagList = tags ? tags.split(',').map((t) => t.trim()) : undefined;
|
|
19
21
|
const channel = await client.channels.fetch(channel_id);
|
|
20
22
|
if (!channel?.threads || channel.type !== ChannelType.GuildForum) {
|
|
21
|
-
throw new Error(
|
|
23
|
+
throw new Error(t(context.locale, 'notForumChannel', { p0: channel_id }));
|
|
22
24
|
}
|
|
23
25
|
const tagIds = tagList?.length
|
|
24
26
|
? channel.availableTags?.filter((tag) => tagList.includes(tag.name)).map((tag) => tag.id)
|
|
@@ -28,6 +30,6 @@ export default defineAgentTool({
|
|
|
28
30
|
message: { content },
|
|
29
31
|
...(tagIds?.length ? { appliedTags: tagIds } : {}),
|
|
30
32
|
});
|
|
31
|
-
return { success: true, thread_id: thread.id, message:
|
|
33
|
+
return { success: true, thread_id: thread.id, message: t(context.locale, 'forumCreated', { p0: name }) };
|
|
32
34
|
},
|
|
33
35
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -12,13 +13,14 @@ export default defineAgentTool<{ channel_id: string; name: string; content: stri
|
|
|
12
13
|
tags: z.string().optional().describe('标签名,逗号分隔(可选)'),
|
|
13
14
|
}),
|
|
14
15
|
adapter: 'discord',
|
|
16
|
+
scopes: ["channel"],
|
|
15
17
|
tags: ['discord'],
|
|
16
18
|
async execute({ channel_id, name, content, tags }: { channel_id: string; name: string; content: string; tags?: string }, context) {
|
|
17
19
|
const client = requireDiscordGatewayClient(context.$client);
|
|
18
20
|
const tagList = tags ? tags.split(',').map((t: string) => t.trim()) : undefined;
|
|
19
21
|
const channel = await client.channels.fetch(channel_id);
|
|
20
22
|
if (!channel?.threads || channel.type !== ChannelType.GuildForum) {
|
|
21
|
-
throw new Error(
|
|
23
|
+
throw new Error(t(context.locale, 'notForumChannel', { p0: channel_id }));
|
|
22
24
|
}
|
|
23
25
|
const tagIds = tagList?.length
|
|
24
26
|
? channel.availableTags?.filter((tag) => tagList.includes(tag.name)).map((tag) => tag.id)
|
|
@@ -28,6 +30,6 @@ export default defineAgentTool<{ channel_id: string; name: string; content: stri
|
|
|
28
30
|
message: { content },
|
|
29
31
|
...(tagIds?.length ? { appliedTags: tagIds } : {}),
|
|
30
32
|
});
|
|
31
|
-
return { success: true, thread_id: thread.id, message:
|
|
33
|
+
return { success: true, thread_id: thread.id, message: t(context.locale, 'forumCreated', { p0: name }) };
|
|
32
34
|
},
|
|
33
35
|
});
|
|
@@ -9,6 +9,7 @@ export default defineAgentTool<{ guild_id: string }>({
|
|
|
9
9
|
guild_id: z.string().describe('服务器 ID'),
|
|
10
10
|
}),
|
|
11
11
|
adapter: 'discord',
|
|
12
|
+
scopes: ["channel"],
|
|
12
13
|
tags: ['discord'],
|
|
13
14
|
permissions: [platformPermission('discord', 'manage_roles')],
|
|
14
15
|
async execute({ guild_id }: { guild_id: string }, context) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -11,6 +12,7 @@ export default defineAgentTool({
|
|
|
11
12
|
role_id: z.string().describe('角色 ID'),
|
|
12
13
|
}),
|
|
13
14
|
adapter: 'discord',
|
|
15
|
+
scopes: ["channel"],
|
|
14
16
|
tags: ['discord'],
|
|
15
17
|
permissions: [platformPermission('discord', 'manage_roles')],
|
|
16
18
|
async execute({ guild_id, user_id, role_id }, context) {
|
|
@@ -19,6 +21,6 @@ export default defineAgentTool({
|
|
|
19
21
|
const member = await guild.members.fetch(user_id);
|
|
20
22
|
await member.roles.remove(role_id);
|
|
21
23
|
const success = true;
|
|
22
|
-
return { success, message: success ?
|
|
24
|
+
return { success, message: success ? t(context.locale, 'memberRoleRemoved', { p0: user_id }) : t(context.locale, 'operationFailed') };
|
|
23
25
|
},
|
|
24
26
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { requireDiscordGatewayClient } from '@zhin.js/adapter-discord';
|
|
@@ -11,6 +12,7 @@ export default defineAgentTool<{ guild_id: string; user_id: string; role_id: str
|
|
|
11
12
|
role_id: z.string().describe('角色 ID'),
|
|
12
13
|
}),
|
|
13
14
|
adapter: 'discord',
|
|
15
|
+
scopes: ["channel"],
|
|
14
16
|
tags: ['discord'],
|
|
15
17
|
permissions: [platformPermission('discord', 'manage_roles')],
|
|
16
18
|
async execute({ guild_id, user_id, role_id }: { guild_id: string; user_id: string; role_id: string }, context) {
|
|
@@ -21,6 +23,6 @@ export default defineAgentTool<{ guild_id: string; user_id: string; role_id: str
|
|
|
21
23
|
};
|
|
22
24
|
await member.roles.remove(role_id);
|
|
23
25
|
const success = true;
|
|
24
|
-
return { success, message: success ?
|
|
26
|
+
return { success, message: success ? t(context.locale, 'memberRoleRemoved', { p0: user_id }) : t(context.locale, 'operationFailed') };
|
|
25
27
|
},
|
|
26
28
|
});
|
package/lib/webhook.d.ts
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* Discord interactions HTTP: signature → parse → admit.
|
|
3
3
|
*/
|
|
4
4
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
5
|
+
import { type Locale } from 'zhin.js/i18n';
|
|
5
6
|
import type { HttpHost, HttpRouteRegistration } from '@zhin.js/host-http';
|
|
6
7
|
import { type DiscordInboundMessage, type DiscordButtonInbound, type ResolvedDiscordInteractionsConfig } from './protocol.js';
|
|
7
8
|
export interface DiscordInteractionsHandler {
|
|
8
9
|
readonly config: ResolvedDiscordInteractionsConfig;
|
|
9
10
|
readonly isOpen: boolean;
|
|
10
11
|
admit(msg: DiscordInboundMessage): void;
|
|
12
|
+
resolveLocale?(senderId: string): Promise<Locale | undefined>;
|
|
11
13
|
admitButton(interaction: DiscordButtonInbound): void;
|
|
12
14
|
admitPlatform(event: Record<string, unknown>): void;
|
|
13
15
|
}
|
package/lib/webhook.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { createMessages } from 'zhin.js/i18n';
|
|
1
2
|
import { getLogger } from '@zhin.js/logger';
|
|
2
3
|
import { interactionToInboundMessage, verifyDiscordInteractionSignature, } from './protocol.js';
|
|
3
4
|
const logger = getLogger('discord');
|
|
5
|
+
const messages = createMessages({
|
|
6
|
+
processing: { 'zh-CN': '处理命令: {command}', en: 'Processing command: {command}' },
|
|
7
|
+
});
|
|
4
8
|
const INTERACTION_TYPE_PING = 1;
|
|
5
9
|
const INTERACTION_TYPE_APPLICATION_COMMAND = 2;
|
|
6
10
|
const INTERACTION_RESPONSE_PONG = 1;
|
|
@@ -52,15 +56,17 @@ export async function handleDiscordInteractionRequest(request, response, handler
|
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
if (interaction.type === INTERACTION_TYPE_APPLICATION_COMMAND) {
|
|
59
|
+
const message = interactionToInboundMessage(interaction);
|
|
55
60
|
if (handler.isOpen) {
|
|
56
|
-
handler.admit(
|
|
61
|
+
handler.admit(message);
|
|
57
62
|
}
|
|
63
|
+
const locale = await handler.resolveLocale?.(message.authorId);
|
|
58
64
|
// 即时响应(type 4):defer(type 5) 需要 followup PATCH,未实现会让用户端一直转圈
|
|
59
65
|
const commandName = String(interaction.data?.name ?? '');
|
|
60
66
|
writeJson(response, 200, {
|
|
61
67
|
type: INTERACTION_RESPONSE_CHANNEL_MESSAGE_WITH_SOURCE,
|
|
62
68
|
data: {
|
|
63
|
-
content:
|
|
69
|
+
content: messages(locale, 'processing', { command: commandName }),
|
|
64
70
|
flags: INTERACTION_FLAG_EPHEMERAL,
|
|
65
71
|
},
|
|
66
72
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-discord",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.16",
|
|
4
4
|
"description": "Zhin.js Discord adapter for Plugin Runtime (Gateway WebSocket)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -34,24 +34,24 @@
|
|
|
34
34
|
"discord.js": "^14.27.0",
|
|
35
35
|
"@discordjs/ws": "1.2.3",
|
|
36
36
|
"@discordjs/collection": "2.1.1",
|
|
37
|
-
"undici": "6.
|
|
38
|
-
"@zhin.js/adapter": "1.1.
|
|
39
|
-
"@zhin.js/agent-feature": "1.1.
|
|
40
|
-
"@zhin.js/core": "1.1.
|
|
41
|
-
"@zhin.js/feature-kit": "1.1.
|
|
42
|
-
"@zhin.js/host-http": "1.1.
|
|
43
|
-
"@zhin.js/im-contract": "1.1.
|
|
37
|
+
"undici": "6.29.1",
|
|
38
|
+
"@zhin.js/adapter": "1.1.23",
|
|
39
|
+
"@zhin.js/agent-feature": "1.1.10",
|
|
40
|
+
"@zhin.js/core": "1.1.51",
|
|
41
|
+
"@zhin.js/feature-kit": "1.1.9",
|
|
42
|
+
"@zhin.js/host-http": "1.1.10",
|
|
43
|
+
"@zhin.js/im-contract": "1.1.7",
|
|
44
44
|
"@zhin.js/logger": "1.1.2",
|
|
45
|
-
"@zhin.js/permission": "1.1.
|
|
46
|
-
"@zhin.js/skill": "1.1.
|
|
47
|
-
"@zhin.js/tool": "1.1.
|
|
45
|
+
"@zhin.js/permission": "1.1.9",
|
|
46
|
+
"@zhin.js/skill": "1.1.10",
|
|
47
|
+
"@zhin.js/tool": "1.1.10"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"zod": "^4.0.0",
|
|
51
|
-
"@zhin.js/adapter": "^1.1.
|
|
52
|
-
"@zhin.js/command": "^1.1.
|
|
53
|
-
"@zhin.js/core": "^1.1.
|
|
54
|
-
"zhin.js": "^1.1.
|
|
51
|
+
"@zhin.js/adapter": "^1.1.23",
|
|
52
|
+
"@zhin.js/command": "^1.1.11",
|
|
53
|
+
"@zhin.js/core": "^1.1.51",
|
|
54
|
+
"zhin.js": "^1.1.16"
|
|
55
55
|
},
|
|
56
56
|
"peerDependenciesMeta": {
|
|
57
57
|
"@zhin.js/command": {
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"typescript": "^6.0.3",
|
|
70
70
|
"vitest": "^4.1.10",
|
|
71
71
|
"zod": "^4.4.3",
|
|
72
|
-
"@zhin.js/host-http": "1.1.
|
|
73
|
-
"zhin.js": "1.1.
|
|
72
|
+
"@zhin.js/host-http": "1.1.10",
|
|
73
|
+
"zhin.js": "1.1.16"
|
|
74
74
|
},
|
|
75
75
|
"files": [
|
|
76
76
|
"adapters",
|
package/schema.json
CHANGED
|
@@ -76,7 +76,12 @@
|
|
|
76
76
|
"string",
|
|
77
77
|
"number"
|
|
78
78
|
],
|
|
79
|
-
"description": "框架 master(Discord user snowflake;AI/工具权限、endpoint 管理)。endpoints[i].master 可逐项覆盖"
|
|
79
|
+
"description": "框架 master(Discord user snowflake;AI/工具权限、endpoint 管理)。endpoints[i].master 可逐项覆盖",
|
|
80
|
+
"x-i18n": {
|
|
81
|
+
"en": {
|
|
82
|
+
"description": "Framework masters (Discord user snowflake; AI/tool permissions and endpoint management). endpoints[i].master can override this value."
|
|
83
|
+
}
|
|
84
|
+
}
|
|
80
85
|
},
|
|
81
86
|
"trusted": {
|
|
82
87
|
"type": "array",
|
|
@@ -87,7 +92,12 @@
|
|
|
87
92
|
],
|
|
88
93
|
"description": "Trusted Discord user snowflake"
|
|
89
94
|
},
|
|
90
|
-
"description": "框架 trusted 用户列表(弱于 master)。endpoints[i].trusted 可逐项追加"
|
|
95
|
+
"description": "框架 trusted 用户列表(弱于 master)。endpoints[i].trusted 可逐项追加",
|
|
96
|
+
"x-i18n": {
|
|
97
|
+
"en": {
|
|
98
|
+
"description": "Framework trusted users, below master authority. endpoints[i].trusted can add users."
|
|
99
|
+
}
|
|
100
|
+
}
|
|
91
101
|
},
|
|
92
102
|
"endpoints": {
|
|
93
103
|
"type": "array",
|
|
@@ -102,7 +112,12 @@
|
|
|
102
112
|
"string",
|
|
103
113
|
"number"
|
|
104
114
|
],
|
|
105
|
-
"description": "本 endpoint 的框架 master(Discord user snowflake);覆盖顶层 master"
|
|
115
|
+
"description": "本 endpoint 的框架 master(Discord user snowflake);覆盖顶层 master",
|
|
116
|
+
"x-i18n": {
|
|
117
|
+
"en": {
|
|
118
|
+
"description": "Framework masters for this endpoint (Discord user snowflake), overriding the top-level master list."
|
|
119
|
+
}
|
|
120
|
+
}
|
|
106
121
|
},
|
|
107
122
|
"trusted": {
|
|
108
123
|
"type": "array",
|
|
@@ -113,7 +128,12 @@
|
|
|
113
128
|
],
|
|
114
129
|
"description": "Trusted Discord user snowflake"
|
|
115
130
|
},
|
|
116
|
-
"description": "本 endpoint 的 trusted 列表"
|
|
131
|
+
"description": "本 endpoint 的 trusted 列表",
|
|
132
|
+
"x-i18n": {
|
|
133
|
+
"en": {
|
|
134
|
+
"description": "Trusted users for this endpoint."
|
|
135
|
+
}
|
|
136
|
+
}
|
|
117
137
|
},
|
|
118
138
|
"token": {
|
|
119
139
|
"type": "string",
|
|
@@ -204,19 +224,34 @@
|
|
|
204
224
|
"required": [
|
|
205
225
|
"port"
|
|
206
226
|
],
|
|
207
|
-
"description": "Gateway测试实例REST专用故障代理:discord.com:443固定loopback TCP,保留SNI/证书校验,独立于Gateway代理"
|
|
227
|
+
"description": "Gateway测试实例REST专用故障代理:discord.com:443固定loopback TCP,保留SNI/证书校验,独立于Gateway代理",
|
|
228
|
+
"x-i18n": {
|
|
229
|
+
"en": {
|
|
230
|
+
"description": "REST-only fault proxy for Gateway tests: pin discord.com:443 TCP to loopback while preserving SNI and certificate validation, independently of the Gateway proxy."
|
|
231
|
+
}
|
|
232
|
+
}
|
|
208
233
|
}
|
|
209
234
|
},
|
|
210
235
|
"required": [
|
|
211
236
|
"id",
|
|
212
237
|
"token"
|
|
213
238
|
]
|
|
239
|
+
},
|
|
240
|
+
"x-i18n": {
|
|
241
|
+
"en": {
|
|
242
|
+
"description": "Multiple accounts: each entry defines an endpoint. id and token are required; other fields override instance defaults."
|
|
243
|
+
}
|
|
214
244
|
}
|
|
215
245
|
},
|
|
216
246
|
"commandPrefix": {
|
|
217
247
|
"type": "string",
|
|
218
248
|
"default": "",
|
|
219
|
-
"description": "命令前缀(默认 '' 无前缀,任意文本按命令匹配;如 '/' 要求 / 开头)。endpoints[i] 可逐项覆盖"
|
|
249
|
+
"description": "命令前缀(默认 '' 无前缀,任意文本按命令匹配;如 '/' 要求 / 开头)。endpoints[i] 可逐项覆盖",
|
|
250
|
+
"x-i18n": {
|
|
251
|
+
"en": {
|
|
252
|
+
"description": "Command prefix. The default empty string allows unprefixed commands; '/' requires a leading slash. Each endpoints[i] can override it."
|
|
253
|
+
}
|
|
254
|
+
}
|
|
220
255
|
},
|
|
221
256
|
"gatewayFaultProxyUrl": {
|
|
222
257
|
"type": "string",
|
package/src/webhook.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Discord interactions HTTP: signature → parse → admit.
|
|
3
3
|
*/
|
|
4
4
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
5
|
+
import { createMessages, type Locale } from 'zhin.js/i18n';
|
|
5
6
|
import type { HttpHost, HttpRouteRegistration } from '@zhin.js/host-http';
|
|
6
7
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
7
8
|
import {
|
|
@@ -13,6 +14,9 @@ import {
|
|
|
13
14
|
} from './protocol.js';
|
|
14
15
|
|
|
15
16
|
const logger = getLogger('discord');
|
|
17
|
+
const messages = createMessages({
|
|
18
|
+
processing: { 'zh-CN': '处理命令: {command}', en: 'Processing command: {command}' },
|
|
19
|
+
});
|
|
16
20
|
|
|
17
21
|
const INTERACTION_TYPE_PING = 1;
|
|
18
22
|
const INTERACTION_TYPE_APPLICATION_COMMAND = 2;
|
|
@@ -25,6 +29,7 @@ export interface DiscordInteractionsHandler {
|
|
|
25
29
|
readonly config: ResolvedDiscordInteractionsConfig;
|
|
26
30
|
readonly isOpen: boolean;
|
|
27
31
|
admit(msg: DiscordInboundMessage): void;
|
|
32
|
+
resolveLocale?(senderId: string): Promise<Locale | undefined>;
|
|
28
33
|
admitButton(interaction: DiscordButtonInbound): void;
|
|
29
34
|
admitPlatform(event: Record<string, unknown>): void;
|
|
30
35
|
}
|
|
@@ -82,9 +87,11 @@ export async function handleDiscordInteractionRequest(
|
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
89
|
if (interaction.type === INTERACTION_TYPE_APPLICATION_COMMAND) {
|
|
90
|
+
const message = interactionToInboundMessage(interaction);
|
|
85
91
|
if (handler.isOpen) {
|
|
86
|
-
handler.admit(
|
|
92
|
+
handler.admit(message);
|
|
87
93
|
}
|
|
94
|
+
const locale = await handler.resolveLocale?.(message.authorId);
|
|
88
95
|
// 即时响应(type 4):defer(type 5) 需要 followup PATCH,未实现会让用户端一直转圈
|
|
89
96
|
const commandName = String(
|
|
90
97
|
(interaction.data as { name?: unknown } | undefined)?.name ?? '',
|
|
@@ -92,7 +99,7 @@ export async function handleDiscordInteractionRequest(
|
|
|
92
99
|
writeJson(response, 200, {
|
|
93
100
|
type: INTERACTION_RESPONSE_CHANNEL_MESSAGE_WITH_SOURCE,
|
|
94
101
|
data: {
|
|
95
|
-
content:
|
|
102
|
+
content: messages(locale, 'processing', { command: commandName }),
|
|
96
103
|
flags: INTERACTION_FLAG_EPHEMERAL,
|
|
97
104
|
},
|
|
98
105
|
});
|