Coze Discord Proxy is a powerful tool that bridges the gap between Discord bots created on the Coze platform and external applications. It acts as a proxy server, enabling users to access advanced AI models like GPT-4 and DALL-E 3 through a standardized API interface that mimics OpenAI's format, making it easy to integrate with existing tools like NextChat and One API.
The project supports advanced features such as dialogue isolation, streaming responses, and load balancing across multiple Discord accounts and bots. It also includes built-in scheduling to keep bots active and allows for the deployment of a robust, self-hosted AI service that leverages the free and paid tiers of the Coze platform.
Use Cases:
中文 | English
代理Discord对话Coze-Bot,实现以API形式请求GPT4模型,提供对话、文生图、图生文、知识库检索等功能
觉得有点意思的话 别忘了点个🌟
📄CDP项目文档站(必看教程)
🐞CDP项目-交流群(交流) (群内提供公益API、AI机器人)
📢CDP项目-通知频道(通知)
NextChat,one-api,LobeChat等对话面板。discord分类/频道/线程。openai对齐的对话接口(v1/chat/completions)(也支持dall-e-3文生图)(支持指定discord-channel)。openai对齐的图生文/图改图/文件生文接口(v1/chat/completions)(按照GPT4V接口的请求格式 [ 支持url或base64 ])(支持指定discord-channel)。openai对齐的dall-e-3文生图接口(v1/images/generations)。9点定时任务自动活跃机器人。Authorization(环境变量USER_AUTHORIZATION)作请求负载均衡(目前每个discord用户调用coze-bot在24h内有次数限制,可配置多用户来实现叠加请求次数及请求负载均衡)。PROXY_SECRET/model指定) 详细请看进阶配置。http://:/swagger/index.html
复制服务器ID(GUILD_ID)并记录,在此服务器中创建默认频道,右键点击此频道选择复制频道ID(CHANNEL_ID)并记录。COZE-BOT,并记录该bot专属的token和id(COZE_BOT_ID),此bot为即将被coze托管的bot。CDP-BOT,并记录该bot专属的token(BOT_TOKEN),此bot为监听discord消息的bot。Administrator)并邀请进创建好的discord服务器 (过程不在此赘述)。https://discord.com/api/v9/channels/1206*******703/messages从该接口header中获取Authorization(USER_AUTHORIZATION)并记录。Auto-Suggestion为Default/on(默认不用改))。COZE-BOT的token,发布完成后在discord服务器中可看到COZE-BOT在线并可以@使用。填 接口地址(ip:端口/域名) 及 API-Key(PROXY_SECRET),其它的随便填随便选。
如果自己没有搭建NextChat面板,这里有个已经搭建好的可以使用 NextChat (https://ci.goeast.io/)
填 BaseURL(ip:端口/域名) 及 密钥(PROXY_SECRET),其它的随便填随便选。
docker-compose pull && docker-compose up -d
version: '3.4'
services:
coze-discord-proxy:
image: deanxv/coze-discord-proxy:latest
container_name: coze-discord-proxy
restart: always
ports:
- "7077:7077"
volumes:
- ./data:/app/coze-discord-proxy/data
environment:
- USER_AUTHORIZATION=MTA5OTg5N************aXUBHVI # 必须修改为我们discord用户的授权密钥(多个请以,分隔)
- BOT_TOKEN=MTE5OT************UrUWNbG63w # 必须修改为监听消息的Bot-Token
- GUILD_ID=11************96 # 必须修改为两个机器人所在的服务器ID
- COZE_BOT_ID=11************97 # 必须修改为由coze托管的机器人ID
- CHANNEL_ID=11************94 # [可选]默认频道-(目前版本下该参数仅用来活跃机器人)
- PROXY_SECRET=123456 # [可选]接口密钥-修改此行为请求头校验的值(多个请以,分隔)
- TZ=Asia/Shanghai
docker run --name coze-discord-proxy -d --restart always \
-p 7077:7077 \
-v $(pwd)/data:/app/coze-discord-proxy/data \
-e USER_AUTHORIZATION="MTA5OTg5N************uIfytxUgJfmaXUBHVI" \
-e BOT_TOKEN="MTE5OTk2************rUWNbG63w" \
-e GUILD_ID="11************96" \
-e COZE_BOT_ID="11************97" \
-e PROXY_SECRET="123456" \
-e CHANNEL_ID="11************24" \
-e TZ=Asia/Shanghai \
deanxv/coze-discord-proxy
其中USER_AUTHORIZATION,BOT_TOKEN,GUILD_ID,COZE_BOT_ID,PROXY_SECRET,CHANNEL_ID修改为自己的。
如果上面的镜像无法拉取,可以尝试使用 GitHub 的 Docker 镜像,将上面的deanxv/coze-discord-proxy替换为ghcr.io/deanxv/coze-discord-proxy即可。
部署到 Zeabur
Zeabur 的服务器在国外,自动解决了网络的问题,同时免费的额度也足够个人使用
点击一键部署:
Deploy on Zeabur (https://zeabur.com/button.svg)
一键部署后 USER_AUTHORIZATION,BOT_TOKEN,GUILD_ID,COZE_BOT_ID,PROXY_SECRET,CHANNEL_ID变量也需要替换!
或手动部署:
首先 fork 一份代码。
进入 Zeabur (https://zeabur.com?referralCode=deanxv),使用github登录,进入控制台。
在 Service -> Add Service,选择 Git(第一次使用需要先授权),选择你 fork 的仓库。
Deploy 会自动开始,先取消。
添加环境变量
USER_AUTHORIZATION:MTA5OTg5N************uIfytxUgJfmaXUBHVI 主动发送消息的discord用户的授权密钥(多个请以,分隔)
Proactive context-aware desktop assistant that captures your screen, stores data locally, and uses OpenAI/Doubao-compatible models to deliver summaries, insights, and todos.
Visual platform for building AI systems, featuring tools for fine-tuning, synthetic data generation, evaluations, and RAG integration.
Open-source, cross-platform third-party KuGou Music client featuring a modern UI, lyric support, and daily tracks.
Cross-platform command-line tool to build, sign, and deploy iOS apps using SwiftPM on Linux, Windows, and macOS.
Modern, lightweight database management tool with AI chat interface, schema visualization, and multi-database support.
Cross-platform desktop GUI for ADB offering screen mirroring, file management, performance monitoring, and debugging tools for Android.