Code Monkey home page Code Monkey logo

express-feishu-chatgpt's Introduction

ChatGPT-Feishu

给飞书用户准备的 ChatGPT 机器人。视频演示如下,生成略慢,请耐心等待~

效果

202302100113456.mp4

如何使用本项目代码?

视频教程见 -> https://youtu.be/axvH1D0Dhnk | https://www.bilibili.com/video/BV1uT411R7TL/

1. 创建一个飞书开放平台应用,并获取到 APPID 和 Secret

访问 开发者后台,创建一个名为 ChatGPT 的应用,并上传应用头像。创建完成后,访问【凭证与基础信息】页面,复制 APPID 和 Secret 备用。

image-20230210012031179

2. 开启机器人能力

打开应用的机器人应用功能

image-20230210012110735

3.docker 方式启动项目

如有需要,可自行根据 dockerfile 文件打包自己的镜像.

git clone https://github.com/anota/express-feishu-chatgpt   #clone项目到本地服务器
cd express-feishu-chatgpt  #进入项目目录
vi docker-compose.yml  #修改为你的密钥信息
docker-compose up -d #后台启动

4. nodejs 方式启动项目

git clone https://github.com/anota/express-feishu-chatgpt#clone项目到本地服务器
cd ~/express-feishu-chatgpt#进入项目目录
npm install#安装npm
npm install pm2@latest -g#安装PM2管理
vi processes.json #修改为你的密钥信息
FEISHU_APP_ID "飞书的应用 ID"; //
FEISHU_APP_SECRET "飞书的应用的 Secret"; //
FEISHU_BOTNAME "飞书机器人的名字"; // 不能是中文
OPENAI_KEY "OpenAI 的 APIKey"; //
pm2 start processes.json

5. 开启权限并配置事件

访问开放平台页面,开通如下 6 个权限:

  • im:message
  • im:message.group_at_msg
  • im:message.group_at_msg:readonly
  • im:message.p2p_msg
  • im:message.p2p_msg:readonly
  • im:message:send_as_bot

image-20230210022432066

复制服务器调用地址。

-IP:9000#自行设置反代或添加证书

然后回到事件订阅界面,添加事件。

image-20230210022720552

6. 发布版本,等待审核

上述这些都配置完成后,你的机器人就配置好了,接下来只需要在飞书开放平台后台找到应用发布,创建一个全新的版本并发布版本即可。

如何贡献?

欢迎通过 issue 提交你的想法,帮助我迭代这个项目 or 直接通过 Pull Request 来提交你的代码。发布成功后,你就可以在飞书当中体验 ChatGPT 了。

image-20230210022834052

有问题沟通可加群

image

FAQ

1. 提交事件订阅地址时提示 Challenge Code 没有返回?

可以看看是不是配置了 Encrypt Key ,暂时不支持对加密数据解密。路径是应用后台 - 事件订阅

image

2. 可以私聊回复,但没办法群聊回复?

确保 6 项开放平台权限都已经开通且已经发布版本,权限进入可用状态。

另一情况是飞书机器人名称与 BOTNAME 变量不一致。由于环境变量不支持中文,如果机器人名称为中文也会造成部署失败。

解决办法:修改飞书机器人的名称为英文,或直接修改代码中的 BOTNAME 值。

LICENSE

GPLv3

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.