将Coze机器人部署至Discord服务器

大家好,我是红石Hong

这篇文章告诉大家如何在Discord上部署免费的GPT3.5/4.0。

Publish to Discord 发布到 Discord

You can publish your Coze bot to Discord and chat with it in Discord channels.
您可以将 Coze 机器人发布到 Discord 并在 Discord 频道中与之聊天。

👀 Publishing to Discord has become easier
👀 发布到 Discord 变得更加容易

We’ve optimized the Discord publishing process. With just few simple steps, you can get your bot running on Discord now!
我们优化了 Discord 发布流程。只需几个简单的步骤,您现在就可以让您的机器人在 Discord 上运行!

1

将 Coze Bot 发布到 Discord

Go to Discord Developer Portal and Create an Application

转到 Discord 开发者门户并创建应用程序

Go to the Discord Developer Portal. At the top of the Applications page, click “New Application”.
转到 Discord 开发者门户。在“应用程序”页面的顶部,单击“新建应用程序”。

After filling in the Application name, you can create a new Discord application.
填写应用程序名称后,您可以创建一个新的 Discord 应用程序。

2

Enable Discord Intents

启用 Discord 意图
In the Application configuration page, switch to “Bot” tab.
在“应用程序配置”页面中,切换到“机器人”选项卡。

In the Privileged Gateway Intents section, enable three permissions (Presence Intent, Server Members Intent, Message Content Intent).
在“特权网关意向”部分中,启用三个权限(状态意向、服务器成员意向、消息内容意向)。

Remember to click save! 记得点击保存!

3

Generate a Discord Bot Token

生成 Discord 机器人令牌
Below the Bot name, click “Reset Token” to generate a new Bot Token, and copy it.
在 Bot 名称下方,单击“重置令牌”以生成新的 Bot 令牌,然后复制它。

4

5

Set the Bot Token in Coze

在 Coze 中设置 Bot Token
Go to Coze bot’s publishing page, click “Configure”
进入Coze bot的发布页面,点击“配置”

6

Paste the Discord bot token and click “Save”.
粘贴 Discord 机器人令牌,然后单击“保存”。

7

Finally, Publish the Coze Bot to Discord

最后,将 Coze 机器人发布到 Discord
Now, you can publish the bot to Discord via Coze!
现在,您可以通过 Coze 将机器人发布到 Discord!8

After publishing, click “Open in Discord” to chat with your bot in Discord, or “Copy link” to share your Discord bot with your friends.
发布后,单击“在 Discord 中打开”以在 Discord 中与您的机器人聊天,或单击“复制链接”与您的朋友分享您的 Discord 机器人。

9

Restart Discord Bot 重启 Discord Bot

If there is no user interaction with your Discord Bot for more than one week, the Discord Bot will be automatically offline. You can restart the Bot by republishing it in Coze.
如果超过一周没有用户与您的 Discord 机器人互动,Discord 机器人将自动离线。您可以通过在 Coze 中重新发布机器人来重新启动它。

10

FAQ

  1. Why my Discord Bot does not respond?
  2. 为什么我的 Discord Bot 没有响应?
    Please check if you have missed any of the above steps. Key omissions may include:
    请检查您是否错过了上述任何步骤。主要遗漏可能包括:

Enabling the three Discord intents and clicking “Save”;
启用三个 Discord 意图并单击“保存”;
Binding the Discord Bot Token to the Bot in Coze and successfully publishing it.
将 Discord Bot Token 绑定到 Coze 中的 Bot 并成功发布。
In addition, in the Discord chat page, please ensure you are @Bot, not @Role.
此外,在 Discord 聊天页面中,请确保您@Bot,而不是@Role。

11

搬运自coze官方教程

将Discord机器人加入至自己的服务器

首先,您需要在 Discord 中创建一个新服务器(或获得现有服务器的管理员权限)。在浏览器中打开您的 Discord 帐户页面 - 这样可以更轻松地在设置页面之间导航。

从设置菜单返回并右键单击所需的频道 (1),在弹出菜单中,选择复制 ID - 您的频道 ID 将被复制 (2)。将它保存在任何文本文档中,这样您就不会回到这一步。

创建一个机器人并将其添加到服务器,复制机器人令牌

要创建机器人,请转到专门的Discord开发人员页面。在不退出 Discord 帐户的情况下,在相邻的浏览器选项卡中打开它。

首先,您需要创建一个应用程序,然后在该应用程序中创建一个机器人并为其配置权限,然后才将机器人添加到服务器。

应用程序选项卡上,选择新建应用程序

1

首先,您需要创建一个应用程序,然后在该应用程序中创建一个机器人并为其配置权限,然后才将机器人添加到服务器。

2

应用程序已创建。转到 Bot (1) 选项卡,然后单击添加 Bot 以添加新机器人。

3

同意向您的应用程序添加机器人。

4

机器人已经创建。关于它的所有信息都将显示在 Bot 选项卡上。您可以在此处更改其名称、添加图像并复制机器人令牌 (1)。您将需要此令牌来在 Appmaster.io 平台上配置 Discord 模块。每次进行更改时,开发人员门户都会提示您保存它们 (2)。

保存机器人令牌,以便您在后续配置过程中不会返回到此步骤。

5

现在转到OAuth2 (1) 选项卡 - 在这里您可以配置权限并获取指向您的机器人的链接。在SCOPES部分,选择bot (2),在BOT PERMISSIONS中,标记您要授予它的权限,在我们的例子中 - 我们只发送消息,因此选择Send Message (3)。然后复制自动生成的 Discord 链接 (4)。

6

将复制的链接粘贴到浏览器的地址栏中并点击它 - 您的应用程序窗口将打开。从下拉列表 (1) 中选择您的服务器,然后单击继续(2)。

7

确保仅授予应用程序(以及在其中创建的机器人)必要的权限,然后将其添加到您的服务器。

8

确保仅授予应用程序(以及在其中创建的机器人)必要的权限,然后将其添加到您的服务器。

9