Git Product home page Git Product logo

coze-discord-proxy's Introduction

coze-discord-proxy

coze+discord 代理服务—通过接口调用被coze托管的discord-bot

觉得有点意思的话 别忘了点个🌟

功能

接口文档:

http://<ip>:<port>/swagger/index.html

示例:

如何使用

  1. 打开 discord开发者平台
  2. 创建bot-A,并记录bot专属的tokenid(COZE_BOT_ID),此bot为被coze托管的bot。
  3. 创建bot-B,并记录bot专属的token(BOT_TOKEN),此bot为我们与discord交互的bot。
  4. 两个bot开通权限对应权限并邀请进服务器指定服务器,记录服务器ID(GUILD_ID) (过程不在此赘述)。
  5. 打开 coze官网 创建自己bot。
  6. 创建好后推送,配置discord-bot的token,即bot-A的token,点击完成后在discord的服务器中可看到bot-A在线并可以@使用。
  7. 配置环境变量,并启动本项目。
  8. 访问接口地址即可开始调试。

部署

基于 Docker-Compose(All In One) 进行部署

docker-compose pull && docker-compose up -d

docker-compose.yml

version: '3.4'

services:
  code-discord-proxy:
    image: deanxv/code-discord-proxy:latest
    container_name: code-discord-proxy
    restart: always
    ports:
      - "7077:7077"
    volumes:
      - ./data/code-discord-proxy:/data
    environment:
      - BOT_TOKEN=MTE5OTk2xxxxxxxxxxxxxxrwUrUWNbG63w  # 必须修改为我们主动发送消息的Bot-Token
      - GUILD_ID=119xxxxxxxx796  # 必须修改为两个机器人所在的服务器ID
      - COZE_BOT_ID=119xxxxxxxx7  # 必须修改为由coze托管的机器人ID
      - PROXY_SECRET=123456  # 修改此行为请求头校验的值(前后端统一)
      - TZ=Asia/Shanghai

基于 Docker 进行部署

docker run --name code-discord-proxy -d --restart always \
-p 7077:7077 \
-e BOT_TOKEN="MTE5OTk2xxxxxxxxxxxxxxrwUrUWNbG63w" \
-e GUILD_ID="119xxxxxxxx796" \
-e COZE_BOT_ID="119xxxxxxxx7" \
-e PROXY_SECRET="123445" \
deanxv/code-discord-proxy

其中,BOT_TOKEN,GUILD_ID,COZE_BOT_ID,PROXY_SECRET修改为自己的。

配置

环境变量

  1. COZE_BOT_ID:MTE5OTk2xxxxxxxxxxxxxxrwUrUWNbG63w 主动发送消息的Bot-Token
  2. GUILD_ID:119xxxxxxxx796 两个机器人所在的服务器ID
  3. COZE_BOT_ID:119xxxxxxxx7 由coze托管的机器人ID
  4. PROXY_SECRET:123456 [可选]请求头校验的值(前后端统一)

其他

Coze 官网 : https://www.coze.com

Discord 开发地址 : https://discord.com/developers/applications

coze-discord-proxy's People

Contributors

deanxv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.