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

# Discord

> Discord 允许你通过已连接的账户处理用户资料、服务器、OAuth 详细信息和应用授权状态。

# Discord

当某个工作流需要你的账户详细信息、服务器成员资格或应用身份数据时，可以使用 Discord。它可以查找用户、列出你的服务器，并检查 OAuth 或授权状态。

## 配置

| 选项 | 是否必填 | 说明 |
| - | - | - |
| 名称 | 否 | 工作流画布中该步骤的标签。 |
| Authentication | 是 | 此步骤要使用的已连接 Discord 账户。 |
| Action | 是 | 要执行的 Discord 操作（例如 Get My User、Get User、List My Guilds、Get My Guild Member）。 |
| Arguments | 是 | 根据该操作的 schema 生成的每个操作表单字段。每个文本字段都有一个 **Insert Variable** 按钮，用于插入 `{{placeholder}}` 值。高级用法还可使用 **Raw JSON** 选项卡。 |
| When the step fails | 否 | 控制此步骤失败时工作流应 **Terminate Workflow** 还是 **Continue**。 |

在配置此步骤之前，请使用登录流程在你工作区的 **Integrations** 中连接 Discord。如果没有可用的活动连接，该步骤会显示一个警告，并提供指向 **Integrations** 的链接，而不是账户选择器。

## Arguments form

当你选择某个操作时，**Arguments** 部分会渲染一个由该操作输入 schema 驱动的表单。引用现有记录的字段包含下拉选择器。

当你更喜欢手动编写完整的参数对象时，请切换到 **Raw JSON** 选项卡。任一选项卡中的更改都会保持同步。

## Common actions

| 操作 | 说明 |
| - | - |
| **Get My User** | 获取已认证的 Discord 用户资料。 |
| **Get User** | 通过 ID 检索 Discord 用户。 |
| **List My Guilds** | 列出已认证用户所属的服务器。 |
| **Get My Guild Member** | 获取已认证用户在某个服务器中的成员记录。 |
| **Get Guild Template** | 检索服务器模板代码的详细信息。 |
| **Get Guild Widget** | 以 JSON 格式获取服务器小部件。 |
| **Get Guild Widget PNG** | 获取服务器小部件图片。 |
| **Get My OAuth2 Authorization** | 获取当前 OAuth2 授权详细信息。 |
| **List My Connections** | 列出已认证用户的已连接账户。 |
| **Get Role Connection** | 获取已认证用户针对某个应用的角色连接。 |
| **Get My Entitlements** | 列出已认证用户的应用授权。 |
| **Get SKU Subscription** | 按 SKU 和订阅 ID 检索特定订阅。 |

破坏性操作，例如删除记录，不在工作流操作选择器中提供。

## Output

此步骤会将 Discord 响应存储为步骤输出。响应的结构取决于该操作。

在后续步骤中使用完整输出引用：

```text theme={null}
{{STEP_IDENTIFIER.output}}
```

## Example

1. 打开 **Integrations**，如果你还没有这样做，就先连接 Discord。
2. 向工作流中添加一个 **Discord** 步骤。
3. 在 **Authentication** 中选择一个已连接的账户。
4. 在 **Action** 中选择 **Get My User**。
5. 填写必填字段。对任何字段值，使用 **Insert Variable** 引用前面某一步的输出。
6. 点击步骤标题中的 **Run** 来测试该操作，然后在 **Output** 中查看返回的有效载荷。

## Use cases

### 检查成员资料

1. Get User
2. Get My Guild Member

### 查看已连接账户

1. Get My OAuth2 Authorization
2. List My Connections
3. Get Role Connection

### 检查服务器访问

1. List My Guilds
2. Get Guild Widget
3. Get Guild Template

## Notes

* 此步骤依赖于你工作区中的已连接 Discord 集成。
* 工作流操作选择器只显示经过筛选的一组操作。拥有 Discord 工具的代理可以使用更多操作。
* 登录界面可能会显示第三方授权品牌标识。

## Using Discord as an Agent Tool

你也可以在 **Agent Editor** 中将 Discord 添加为工具。打开代理，点击 **Add tool**，然后选择 **Discord**。在工具设置面板中，选择代理应使用的已连接账户。当这些 Discord 操作与对话相关时，代理就会调用它们。

另请参阅：[Integrations](https://docs.fetchhive.com/zh/workspace/integrations.md)、[Creating and Editing](https://docs.fetchhive.com/zh/workflows/creating-and-editing.md) 和 [Testing and Iteration](https://docs.fetchhive.com/zh/workflows/testing-and-iteration.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.