> 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). Agents can also search and read this documentation through its [MCP server](https://docs.convai.com/api-docs/~gitbook/mcp).

# 创建 Discord Bot

创建你自己的 Discord Bot，与不同服务器中的人分享。

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

1. 前往 [Discord 开发者门户](https://discord.com/developers/applications)

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fdyona2KbqtXWRzIjeoRh%2Fdbc-ss-1.png?alt=media&amp;token=59d5c2a7-0129-4d6d-b1db-9fb5807efd8e" alt=""><figcaption></figcaption></figure>
2. 点击 **新建应用程序**

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FRC7mqhsmJxAy6ycXYpG8%2Fdbc-ss-2.png?alt=media&amp;token=2d4bef03-37fc-4c9e-9d6d-2aecadc8c3d8" alt=""><figcaption></figcaption></figure>
3. 输入你想创建的机器人的名称。我们就用 **ConvaiTracy**
4. 接受《开发者服务条款》和《开发者政策》，然后点击 **创建**.

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fvn6C7lQlcTrTUYJ6gXQw%2Fdbc-ss-3.png?alt=media&amp;token=9b961e9b-9531-4f04-8f53-0836433fcbba" alt=""><figcaption></figcaption></figure>
5. 现在你会进入应用程序详情页面。上传应用图标，并按需填写描述，然后点击“保存更改”。

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2F1OAL7f4qWdHzHjz1rgpL%2Fdbc-ss-4.png?alt=media&amp;token=ebfdcc87-33b8-427e-816b-32d7ca30cfea" alt=""><figcaption></figcaption></figure>
6. 然后点击 **OAuth2** --> **URL 生成**器

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FU8pWZGaLCYDVHpnnrpMl%2Fdbc-ss-5.png?alt=media&amp;token=f39056ec-c9d1-4c14-bca4-6172ffd9e21d" alt=""><figcaption></figcaption></figure>
7. 点击 **机器人** 复选框（位于 **权限范围** 部分下）

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FJh426SZX69YwQxG9KQLt%2Fdbc-ss-6.png?alt=media&amp;token=19ce4d46-835e-40e2-a25a-56e0eaafb562" alt=""><figcaption></figcaption></figure>
8. 在各项权限类别下，点击以下复选框

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

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FyxlhJvRD37KhN4XP0P6n%2Fdbc-ss-7.png?alt=media&amp;token=2cc5995a-f642-4b77-a7cd-ae14a74f3eb1" alt=""><figcaption></figcaption></figure>
9. 复制下方生成的 URL。这是可在所有服务器上分享的机器人邀请链接。

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2F2KNBniuEJpAFEasxteX2%2Fdbc-ss-8.png?alt=media&amp;token=f8f95ce2-13e4-4e8e-b8f9-f3298c6344eb" alt=""><figcaption></figcaption></figure>
10. 接下来点击 **机器人**
11. 点击 **添加机器人** --> **是的，执行！**

    <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fy4ueHlTuz811bSPQim6B%2Fdbc-ss-9.png?alt=media&amp;token=ac5e425e-5128-4828-8757-59d4aa66987b" alt=""><figcaption></figcaption></figure>
12. 在 **特权意图** 部分启用以下意图，然后点击 **保存更改。**

    <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FLKyq00UsEm66UOEqX8aW%2Fdbc-ss-10.png?alt=media&amp;token=cdfa1ed0-160e-4980-a889-fc991b60583d" alt=""><figcaption></figcaption></figure>
13. 点击 **重置令牌** 为机器人生成新令牌。然后点击 **是的，执行**

    <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FCmXLYNsKA5EGFP3NzyWH%2Fdbc-ss-11.png?alt=media&amp;token=4d0bf88b-4ceb-4c79-8d26-ed08393415c0" alt=""><figcaption></figcaption></figure>
14. **复制** 生成的令牌，以便稍后用于托管机器人服务器。

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

{% content-ref url="/pages/164c6c4f8dd87bc05eb88c0cc49438037a5c17d0" %}
[从个人服务器托管 Discord Bot](https://docs.convai.com/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
