> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avibe.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord

> 通过 Avibe 把 Discord channel 连接到 Claude Code、OpenCode 或 Codex。

# Discord

Discord 适合个人服务器、社区服务器和轻量移动工作流。

## 你会得到什么

* 从任意 Discord channel 和本地编码 agent 对话。
* 保持会话相互隔离——Avibe 为每个任务新开一个 thread，对齐 Slack 式会话。
* 把选定 channel 路由到选定 agent 后端。
* 接收流式进展和完成更新。

## 创建 bot

1. 打开 [Discord 开发者门户](https://discord.com/developers/applications) → **New Application**，起个名。
2. 进 **Bot → Add Bot**，复制 **Bot token**。
3. 在 **Bot → Privileged Gateway Intents** 里，启用 **Message Content Intent**（必需）。Server Members Intent 可选。
4. 在 **OAuth2 → URL Generator** 里，勾选 **bot** scope 和这些权限：View Channels、Send Messages、Create Public Threads、Send Messages in Threads、Add Reactions、Attach Files。打开生成的 URL，把 bot 邀请进你的服务器。
5. 在 Avibe 向导里选择 **Discord**，粘贴 bot token，**Validate**，选服务器，启用 channel。

> Discord 最常见的坑是没开 **Message Content Intent**——bot 连上了，却看不到消息文本。私信里 Discord 没有 thread，但会话仍按消息隔离。

## 冒烟测试

在启用的 Discord channel 里发送短消息：

```text theme={null}
Say hello and tell me what backend you are using.
```

然后在本地运行：

```bash theme={null}
vibe status
```

## 出站代理

当运行 Avibe 的机器无法直接访问 Discord 时，可在 Web UI 中给 Discord 配置块设置 `proxy_url`。支持 HTTP/HTTPS 代理，以及任意 `socks*://` 协议的 SOCKS 代理（`socks4`、`socks4a`、`socks5`、`socks5h`）。保存配置块只会持久化变更；之后执行 `vibe restart --delay-seconds 60`，让新的传输方式应用到正在运行的连接上。

## 常见问题

| 症状             | 检查                                         |
| -------------- | ------------------------------------------ |
| Bot 沉默         | Bot token、server 安装、channel 选择             |
| Bot 连上了却忽略消息   | 开发者门户里是否启用了 **Message Content Intent**     |
| 消息到了但没有回复      | Agent 后端是否启用，CLI 路径是否有效                    |
| 项目不对           | Channel 路由和默认工作目录                          |
| 机器无法访问 Discord | Discord 配置上的 `proxy_url`；查看日志中的防火墙或 TLS 错误 |
