Discord 是做什么的?
使用 message 工具,并设置 channel: "discord"。无需单独的 Discord 工具。
规则
- 遵守
channels.discord.actions.*的权限控制。 - 优先使用明确的
guildId、channelId、messageId、userId。 - 多账户:需要时传递
accountId。 - 发送目标:
to: "channel:<id>"或to: "user:<id>"。 - 以
<@USER_ID>格式提及用户。 - 在出站 Discord 消息中避免使用 Markdown 表格。
- 优先使用 v2 组件构建丰富 UI;不要将 v2
components与旧版embeds混用。
常见操作
发送:
{ "action": "send", "channel": "discord", "to": "channel:123", "message": "你好", "silent": true }
发送媒体:
{
"action": "send",
"channel": "discord",
"to": "channel:123",
"message": "看附件",
"media": "file:///tmp/example.png"
}
组件 v2:
{
"action": "send",
"channel": "discord",
"to": "channel:123",
"message": "状态",
"components": "[Carbon v2 components]"
}
回应:
{ "action": "react", "channel": "discord", "channelId": "123", "messageId": "456", "emoji": "👍" }
读取:
{ "action": "read", "channel": "discord", "to": "channel:123", "limit": 20 }
编辑/删除:
{
"action": "edit",
"channel": "discord",
"channelId": "123",
"messageId": "456",
"message": "修正了错字"
}
{ "action": "delete", "channel": "discord", "channelId": "123", "messageId": "456" }
投票:
{
"action": "poll",
"channel": "discord",
"to": "channel:123",
"pollQuestion": "午饭吃啥?",
"pollOption": ["披萨", "寿司"],
"pollDurationHours": 24
}
置顶:
{ "action": "pin", "channel": "discord", "channelId": "123", "messageId": "456" }
线程:
{
"action": "thread-create",
"channel": "discord",
"channelId": "123",
"messageId": "456",
"threadName": "bug 分类"
}
搜索:
{
"action": "search",
"channel": "discord",
"guildId": "999",
"query": "发布说明",
"channelIds": ["123"],
"limit": 10
}
状态(通常需要额外权限):
{
"action": "set-presence",
"channel": "discord",
"activityType": "playing",
"activityName": "OpenClaw",
"status": "online"
}