> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/other-integrations/discord/create-a-discord-bot.md).

# 创建 Discord Bot

按照以下步骤创建你自己的 Discord 机器人：

1. 导航到 [Discord 开发者门户](https://discord.com/developers/applications)

   <figure><img src="/files/f99ce225cca5070aa89b23c135391dbf7d4ace48" alt=""><figcaption></figcaption></figure>
2. 点击 **新建应用程序**

   <figure><img src="/files/8c6f5869200d3211875e6342cdda845a885980fd" alt=""><figcaption></figcaption></figure>
3. 输入你想创建的机器人名称。我们就用 **ConvaiTracy**
4. 接受开发者服务条款和开发者政策，然后点击 **创建**.

   <figure><img src="/files/c1b3e4df7bcdc8d6eba7d2e31e0577f16a569d34" alt=""><figcaption></figcaption></figure>
5. 现在，你会进入应用详情页面。上传应用图标，并根据需要填写描述，然后点击保存更改。

   <figure><img src="/files/87a80fbade350e8d997432d18aa7fb828a81bcf0" alt=""><figcaption></figcaption></figure>
6. 然后点击 **OAuth2** --> **URL 生成**器

   <figure><img src="/files/bdd1547f18fc2435aa2f3f14fed684b228afc650" alt=""><figcaption></figcaption></figure>
7. 点击 **机器人** 下方的复选框 **范围** 部分

   <figure><img src="/files/ff615d8c46437094fa75a473378bf46d6a8f4a44" alt=""><figcaption></figcaption></figure>
8. 勾选各项权限下的以下复选框

   1. 常规权限：
      1. 管理 Webhook
   2. 文本权限：
      1. 所有复选框
   3. 语音权限：
      1. 连接
      2. 发言
      3. 使用语音活动
      4. 优先发言者
      5. 请求发言

   <figure><img src="/files/3c81b3d5a520b6387ae995885d7e4170eb9403db" alt=""><figcaption></figcaption></figure>
9. 复制下方生成的 URL。这将是该机器人在所有服务器上的可分享邀请链接。

   <figure><img src="/files/23f003d01bf7c742c87679a7f16375c2903e94d2" alt=""><figcaption></figcaption></figure>
10. 接下来点击 **机器人**
11. 点击 **添加机器人** --> **是的，执行吧！**

    <figure><img src="/files/7908f7d0b49a7012f2a18cab0ab72b6b95ea20ed" alt=""><figcaption></figcaption></figure>
12. 在以下部分中启用下列 intents **特权意图** 部分，然后点击 **保存更改。**

    <figure><img src="/files/faa59a1049ab834717f9296892530214ac518380" alt=""><figcaption></figcaption></figure>
13. 点击 **重置令牌** 以为机器人生成一个新令牌。然后点击 **是的，执行吧**

    <figure><img src="/files/61debd11af6ddc3d27eb32066c50139d66426795" alt=""><figcaption></figcaption></figure>
14. **复制** 生成的令牌，稍后用于托管机器人服务器。

现在我们继续将 Discord 机器人与 Convai 角色连接，并托管服务器。

{% content-ref url="/pages/164c6c4f8dd87bc05eb88c0cc49438037a5c17d0" %}
[从个人服务器托管 Discord Bot](/api-docs/zh/cha-jian-yu-ji-cheng/other-integrations/discord/hosting-discord-bot-from-personal-server.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/other-integrations/discord/create-a-discord-bot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
