Coder Social home page Coder Social logo

midjourney-wechatbot's Introduction

ChatGPT-MidJourney-WeChatbot

项目介绍

使用在微信群中使用ChatGPT-MidJourney微信机器人,使用效果如下图所示:

使用介绍

1.使用MidJourney 生成图片需要@我们的机器人 + mj +咒语,例如:

 @bot mj Cool shaped mecha, holding double swords, future robot concept design, strong limbs, exaggerated and powerful fighting movements, three-quarter composition, 3D, 3D modeling, texture rendering, CG concept, perfect body light, mainly in black and blue tones, art station, future cool, solid background

2.使用MidJourney 扩展图片需要@我们的机器人 + ex + 唯一标识符+,+V/U[1-4]例如:

 @bot ex 354557567567,U3

3.使用ChatGPT 聊天需要@我们的机器人 +内容,例如:

 @bot 使用java完成冒泡排序

快速开始

1.安装go环境

使用go 1.16.2版本,安装go环境

2.配置环境变量

找到go的安装目录,将bin目录添加到环境变量中

3.检测go环境

在命令行中输入go version,如果出现go的版本信息,则说明go环境配置成功

4.安装依赖

进入命令提示符下,输入 go env -w GOPROXY=https: //goproxy.io,direct 在项目根目录下,执行go mod tidy,安装依赖

5.配置环境-进入文件目录:复制config.dev.json 为config.json,并修改其中的配置信息

{
  // ChatGPT的api的key
  "api_key": "",
  // 是否开启自动通过好友请求
  "auto_pass": true,
  // 请求chatgpt的url
  "chat_url": "",
  // 请求midjourney的生成图片的url
  "mj_img_url": "",
  // 请求midjourney的扩展图片的url
  "mj_ex_url": "",
  // midjourney生成图后回调的url
  "webhook":""
}
注:
1.如果不需要使用midjourney的功能,可以不配置mj_img_url,mj_ex_url,webhook
2.api_key获取方式请参考:https://platform.openai.com/overview
3.chat_url默认为https://api.openai.com/ 被墙的话可以使用代理
4.mj_img_url,mj_ex_url为midjourney的url,需要自己搭建midjourney服务
5.webhook为midjourney生成图后回调的url 需要填当前服务器的ip+端口+/mj/v3/webhook。例如: http://127.0.0.1:9095/mj/v3/webhook

运行

在windows下,Goland中运行main.go即可

或在项目根目录下,执行go run main.go

在linux下,在项目根目录下,执行go build main.go生成可执行文件,然后执行./main

或在项目根目录下,执行go run main.go

最后复制网址到浏览器中打开,扫码登录即可

注: 在liunx下希望后台运行,可以使用nohup命令,例如:

nohup ./main &
或
nohup go run main.go &

最后

如果有问题,可以联系我,微信号:chat22223

Image

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.