Giter Club home page Giter Club logo

wechatrobot-java's Introduction

weChatRobot

一个基于微信公众号的智能聊天机器人项目,支持图灵机器人(V2)和ChatGPT对话模式回复内容

本项目还有Go实现的版本:https://github.com/MartinDai/weChatRobot-go

qrcode

项目介绍:

本项目是一个微信公众号项目,需配合微信公众号使用,在微信公众号配置本项目运行的服务器域名,用户关注公众号后,向公众号发送任意信息,公众号会根据用户发送的内容自动回复。

涉及框架及技术

  • Jdk 1.8
  • SpringBoot
  • Jackson
  • Logback + Slf4j
  • OkHttp

支持的功能

  • 自定义关键字回复内容
  • 调用ChatGPT接口回复内容(需配置启动参数或者环境变量:OPENAI_API_KEY
  • 调用图灵机器人(V2)接口回复内容(需配置启动参数或者环境变量:TULING_API_KEY

使用说明:

  1. 使用之前需要有微信公众号的帐号,没有的请戳微信公众号申请
  2. 如果需要使用图灵机器人的回复内容则需要注册图灵机器人帐号获取相应的ApiKey并配置在启动参数或者环境变量中。
  3. 如果需要使用ChatGPT的回复内容则需要创建OpenAI的API Key并配置在启动参数或者环境变量中。需保证服务所在的地区网络可以正常访问OpenAI
  4. 内容响应来源的优先级自定义关键 > ChatGPT > 图灵机器人
  5. 在微信公众号后台配置回调URL为http://robot.doodl6.com/weChat/receiveMessage,其中robot.doodl6.com是你自己的域名,token与config.yml里面配置的保持一致即可。

开发部署

本地启动

直接运行类com.doodl6.wechatrobot.WebStarter

本地jar包运行

本地打包得到weChatRobot.jar这个文件,使用命令java -jar weChatRobot.jar即可运行,

服务器jar包部署

使用命令mvn clean install -P deploy打包得到jar文件,上传到服务器后使用命令nohup java -jar weChatRobot.jar > ./console.log 2>&1 &在后台运行,在执行命令的当前目录查看console日志以及logs目录查看业务日志

Docker运行

执行下面这行命令可以得到一个编译好的镜像

docker build -f docker/Dockerfile --no-cache -t wechatrobot:latest .

编译好镜像以后,执行下面的命令,可以后台启动项目

docker run --name wechatrobot -p 8080:8080 -d wechatrobot:latest

感谢赞助

jetbrains

wechatrobot-java's People

Contributors

martindai avatar dependabot[bot] avatar devfozgul 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.