> 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 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. 点击 **bot** 复选框，位于 **Scopes** 部分下方

   <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. 管理 Webhooks
   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](/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.
