Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

Discord

了解如何配置 LibreChat 以使用 Discord 进行用户身份验证。

创建一个新的 Discord 应用程序

image

Discord 应用程序配置

  • 在 OAuth2 常规设置中添加一个有效的重定向 URL:
    • localhost 的示例:http://localhost:3080/oauth/discord/callback
    • 域名示例:https://example.com/oauth/discord/callback

image

  • Default Authorization Link 中,选择 In-app Authorization 并将 scopes 设置为 applications.commands

image

  • 保存更改并重置 Client Secret

image image

.env 配置

  • 将您的 Client IDClient Secret 粘贴到 .env 文件中:
DOMAIN_CLIENT=https://your-domain.com # use http://localhost:3080 if not using a custom domain
DOMAIN_SERVER=https://your-domain.com # use http://localhost:3080 if not using a custom domain
 
DISCORD_CLIENT_ID=your_client_id
DISCORD_CLIENT_SECRET=your_client_secret
DISCORD_CALLBACK_URL=/oauth/discord/callback
  • 保存 .env 文件

注意:如果使用 Docker,请运行 docker compose up -d 以应用 .env 配置更改

这篇指南怎么样?