ClawSkills logoClawSkills

Discord Chat

使用消息工具在 Discord 频道中发送消息、回复消息并搜索消息历史记录。当用户想要与 Discord 通信时使用(se

介绍

# Discord Chat

使用 Clawdbot 的 `message` 工具与 Discord 频道交互。

## 核心操作

### 发送消息

向 Discord 频道发送消息:

```bash message action=send channel=discord target="#channel-name" message="Your message here" ```

或者通过频道 ID:

```bash message action=send channel=discord target="1234567890" message="Your message here" ```

**提示:** - 使用带 `#` 前缀的频道名称或频道 ID - 对于多个链接,请用 `<>` 包裹以禁用嵌入预览:`<https://example.com>` - 请勿使用 Markdown 表格!请改用无序列表 - 支持通过 `effect=balloons` 或 `effectId=invisible-ink` 添加特效

### 回复消息

回复特定消息:

```bash message action=send channel=discord target="#channel-name" message="Reply text" replyTo="message-id" ```

`replyTo` 参数会创建对指定消息 ID 的线程化回复。

### 搜索消息

在频道中搜索消息:

```bash message action=search channel=discord channelId="1234567890" query="search terms" limit=50 ```

**搜索选项:** - `query`:搜索词 - `authorId`:按作者筛选 - `before`/`after`/`around`:用于分页的消息 ID - `limit`:最大结果数(默认为 25)

有关高级搜索模式,请参阅 [SEARCH.md](references/SEARCH.md)。

### 其他操作

**读取消息:** ```bash message action=read channel=discord target="#channel-name" limit=20 ```

**对消息做出反应:** ```bash message action=react channel=discord messageId="1234567890" emoji="👍" ```

**编辑消息:** ```bash message action=edit channel=discord messageId="1234567890" message="Updated text" ```

**删除消息:** ```bash message action=delete channel=discord messageId="1234567890" ```

## 快速参考

常用模式:

- **发布到频道**:`action=send target="#announcements"` - **在线程中回复**:`action=send replyTo="msg-id"` - **最近活动**:`action=read limit=10` - **查找提及**:`action=search query="@username"` - **确认收到**:`action=react emoji="✅"`

## 频道管理

**列出频道:** ```bash message action=channel-list channel=discord guildId="server-id" ```

**获取频道信息:** ```bash message action=channel-info channel=discord channelId="1234567890" ```

有关创建/编辑频道,请参阅 [CHANNELS.md](references/CHANNELS.md)。

## 最佳实践

1. **尽可能使用目标名称** - `target="#general"` 比使用 ID 更清晰 2. **批量反应** - 每条消息一个表情符号,选择最贴切的一个 3. **按 Discord 格式排版** - 使用无序列表而非表格,使用 `<link>` 来禁用嵌入预览 4. **先搜索再提问** - 在请求信息前先检查历史记录 5. **反应优于回复** - 使用表情符号进行简单的确认

## 配置

您的 Discord 机器人配置应位于网关配置中。当指定 `channel=discord` 时,`message` 工具会自动路由到已配置的 Discord 插件。

有关设置帮助,请参阅 [CONFIG.md](references/CONFIG.md)。

更多产品