A pretty interesting wechat robot project, ideal to design it as a multifunctional robot assistant?
Dean DLL ,千寻框架vlw框架, please refer to framework directoryplugins directory are now integrated. Please refer to the plugins directory.? Notice:
微信的hook software, so you only need to set the callback address on this type of software.Dean DLL ,千寻vlw frameworks. If you have other frameworks, you can add them yourself (refer to the framework directory and implement IFramework interface), or contact me to addhook software, you need to use search engines to find it yourselfFunctional example:

config.yaml file comment instructions for specific configuration 
config.yaml file comment instructions for specific configuration 
// IFramework 这是接入框架所定义的接口
type IFramework interface {
// Callback 这是消息回调方法,vx框架回调消息转发给该Server
Callback ( func ( * Event , IFramework ))
// GetMemePictures 获取表情包图片地址(迷因图)
// return: 图片链接(网络URL或图片base64)
GetMemePictures ( message * Message ) string
// SendText 发送文本消息
// toWxId: 好友ID/群ID
// text: 文本内容
SendText ( toWxId , text string ) error
// SendTextAndAt 发送文本消息并@,只有群聊有效
// toGroupWxId: 群ID
// toWxId: 好友ID/群ID/all
// toWxName: 好友昵称/群昵称,留空为自动获取
// text: 文本内容
SendTextAndAt ( toGroupWxId , toWxId , toWxName , text string ) error
// SendImage 发送图片消息
// toWxId: 好友ID/群ID
// path: 图片路径
SendImage ( toWxId , path string ) error
// SendShareLink 发送分享链接消息
// toWxId: 好友ID/群ID
// title: 标题
// desc: 描述
// imageUrl: 图片链接
// jumpUrl: 跳转链接
SendShareLink ( toWxId , title , desc , imageUrl , jumpUrl string ) error
// SendFile 发送文件消息
// toWxId: 好友ID/群ID/公众号ID
// path: 本地文件绝对路径
SendFile ( toWxId , path string ) error
// SendVideo 发送视频消息
// toWxId: 好友ID/群ID/公众号ID
// path: 本地视频文件绝对路径
SendVideo ( toWxId , path string ) error
// SendEmoji 发送表情消息
// toWxId: 好友ID/群ID/公众号ID
// path: 本地动态表情文件绝对路径
SendEmoji ( toWxId , path string ) error
// SendMusic 发送音乐消息
// toWxId: 好友ID/群ID/公众号ID
// name: 音乐名称
// author: 音乐作者
// app: 音乐来源(VLW需留空),酷狗/wx79f2c4418704b4f8,网易云/wx8dd6ecd81906fd84,QQ音乐/wx5aa333606550dfd5
// jumpUrl: 音乐跳转链接
// musicUrl: 网络歌曲直链
// coverUrl: 封面图片链接
SendMusic ( toWxId , name , author , app , jumpUrl , musicUrl , coverUrl string ) error
// SendMiniProgram 发送小程序消息
// toWxId: 好友ID/群ID/公众号ID
// ghId: 小程序ID
// title: 标题
// content: 内容
// imagePath: 图片路径, 本地图片路径或网络图片URL
// jumpPath: 小程序点击跳转地址,例如:pages/index/index.html
SendMiniProgram ( toWxId , ghId , title , content , imagePath , jumpPath string ) error
// SendMessageRecord 发送消息记录
// toWxId: 好友ID/群ID/公众号ID
// title: 仅供电脑上显示用,手机上的话微信会根据[显示昵称]来自动生成 谁和谁的聊天记录
// dataList:
// - wxid: 发送此条消息的人的wxid
// - nickName: 显示的昵称(可随意伪造)
// - timestamp: 10位时间戳
// - msg: 消息内容
SendMessageRecord ( toWxId , title string , dataList [] map [ string ] interface {}) error
// SendMessageRecordXML 发送消息记录(XML方式)
// toWxId: 好友ID/群ID/公众号ID
// xmlStr: 消息记录XML代码
SendMessageRecordXML ( toWxId , xmlStr string ) error
// SendFavorites 发送收藏消息
// toWxId: 好友ID/群ID/公众号ID
// favoritesId: 收藏夹ID
SendFavorites ( toWxId , favoritesId string ) error
// SendXML 发送XML消息
// toWxId: 好友ID/群ID/公众号ID
// xmlStr: XML代码
SendXML ( toWxId , xmlStr string ) error
// SendBusinessCard 发送名片消息
// toWxId: 好友ID/群ID/公众号ID
// targetWxId: 目标用户ID
SendBusinessCard ( toWxId , targetWxId string ) error
// AgreeFriendVerify 同意好友验证
// v3: 验证V3
// v4: 验证V4
// scene: 验证场景
AgreeFriendVerify ( v3 , v4 , scene string ) error
// InviteIntoGroup 邀请好友加入群组
// groupWxId: 群ID
// wxId: 好友ID
// typ: 邀请类型,1-直接拉,2-发送邀请链接
InviteIntoGroup ( groupWxId , wxId string , typ int ) error
// GetObjectInfo 获取对象信息
// wxId: 好友ID/群ID/公众号ID
// return: User, error
GetObjectInfo ( wxId string ) ( * User , error )
// GetFriends 获取好友列表
// isRefresh: 是否刷新 false-从缓存中获取,true-重新遍历二叉树并刷新缓存
// return: []*User, error
GetFriends ( isRefresh bool ) ([] * User , error )
// GetGroups 获取群组列表
// isRefresh: 是否刷新 false-从缓存中获取,true-重新遍历二叉树并刷新缓存
// return: []*User, error
GetGroups ( isRefresh bool ) ([] * User , error )
// GetGroupMembers 获取群成员列表
// groupWxId: 群ID
// isRefresh: 是否刷新 false-从缓存中获取,true-重新遍历二叉树并刷新缓存
// return: []*User, error
GetGroupMembers ( groupWxId string , isRefresh bool ) ([] * User , error )
// GetMPs 获取公众号订阅列表
// isRefresh: 是否刷新 false-从缓存中获取,true-重新遍历二叉树并刷新缓存
// return: []*User, error
GetMPs ( isRefresh bool ) ([] * User , error )
}import _ "github.com/yqchilde/wxbot/plugins/baidubaike"import _ "github.com/yqchilde/wxbot/plugins/chatgpt"import _ "github.com/yqchilde/wxbot/plugins/crazykfc"import _ "github.com/yqchilde/wxbot/plugins/memepicture"import _ "github.com/yqchilde/wxbot/plugins/moyuban"import _ "github.com/yqchilde/wxbot/plugins/pinyinsuoxie"import _ "github.com/yqchilde/wxbot/plugins/plmm"import _ "github.com/yqchilde/wxbot/plugins/weather"import _ "github.com/yqchilde/wxbot/plugins/zaobao"import _ "github.com/yqchilde/wxbot/plugins/manager"import _ "github.com/yqchilde/wxbot/plugins/ghmonitor"import _ "github.com/yqchilde/wxbot/plugins/wordcloud"import _ "github.com/yqchilde/wxbot/plugins/chaid"import _ "github.com/yqchilde/wxbot/plugins/youdaofanyi"import _ "github.com/yqchilde/wxbot/plugins/friendadd"import _ "github.com/yqchilde/wxbot/plugins/choose"import _ "github.com/yqchilde/wxbot/plugins/localimage"import _ "github.com/yqchilde/wxbot/plugins/localimagespider"Click to see what instructions are available for the robot
git clone https://github.com/yqchilde/wxbot.git Configure config.yaml
Debug run or compile
go run main.gomake releasebash -c " $( curl -fsSL https://raw.fastgit.org/yqchilde/wxbot/hook/docker/run.sh ) "config.yaml in advance, otherwise an error will be reported. docker run -d
--name= " wxbot "
-p 9528:9528
-v $( pwd ) /config.yaml:/app/config.yaml
-v $( pwd ) /data:/app/data
yqchilde/wxbot:latestfork this project firstWXBOT_TOKEN , and the value is the token obtained abovev1.0.0 , and then wait for the actions to be compiled. After the compilation is completed, the corresponding wxbot file will be generated in release ?If you want to extend your own plugin, you can refer to the plugins in the plugins directory
?If you want to extend other frameworks, you can refer to the frameworks in the frameworks directory
?If you need to add or delete plugins, you can edit the code in plugins.yaml to remove the import of the corresponding plugins or add the import of the corresponding plugins, and just draw the picture.
?After modifying plugins.yaml , you need to execute make plugins or go generate -tags plugins ./engine/plugins to generate the corresponding plugins.go file before compiling
- " github.com/yqchilde/wxbot/plugins/baidubaike " # 百度百科
- " github.com/yqchilde/wxbot/plugins/chatgpt " # GPT聊天
- " github.com/yqchilde/wxbot/plugins/crazykfc " # 肯德基疯狂星期四骚话
- " github.com/yqchilde/wxbot/plugins/ghmonitor " # 公众号消息监控转发
- " github.com/yqchilde/wxbot/plugins/manager " # 群组管理相关
- " github.com/yqchilde/wxbot/plugins/memepicture " # 表情包原图
- " github.com/yqchilde/wxbot/plugins/moyuban " # 摸鱼办
- " github.com/yqchilde/wxbot/plugins/pinyinsuoxie " # 拼音缩写翻译
- " github.com/yqchilde/wxbot/plugins/plmm " # 漂亮妹妹
- " github.com/yqchilde/wxbot/plugins/weather " # 天气查询
- " github.com/yqchilde/wxbot/plugins/zaobao " # 每日早报
- " github.com/yqchilde/wxbot/plugins/wordcloud " # 聊天热词
- " github.com/yqchilde/wxbot/plugins/chaid " # 查wxId
- " github.com/yqchilde/wxbot/plugins/youdaofanyi " # 有道翻译See more use cases
| Environment variable name | Variable type | illustrate |
|---|---|---|
| DEBUG | bool | The priority is greater than other variables starting with DEBUG_ . After turning on, all DEBUG modes are enabled for debugging HTTP requests and call log file names and line numbers. |
| DEBUG_LOG | bool | Used to debug call log file name and line number |
import (
"errors"
"fmt"
"strings"
"sync"
"time"
"github.com/PullRequestInc/go-gpt3"
"github.com/yqchilde/wxbot/engine/control"
"github.com/yqchilde/wxbot/engine/pkg/log"
"github.com/yqchilde/wxbot/engine/pkg/sqlite"
"github.com/yqchilde/wxbot/engine/robot"
)插件, please add the corresponding plugin in plugins.yaml插件, please add the corresponding plug-in to the existing plug-in section in README.md插件, please add the corresponding plugin in plugins/README.mdmake plugins or go generate -tags plugins ./engine/plugins to generate the corresponding plugins.go file first. Development Plan: Development Plan If you find this project interesting, please click on the star
This project will be replenished and replenished a lot of things. Due to work, I will take time to do it. Thank you for discovering and using this warehouse
If you have any questions, you can join the Q group to discuss

yqchilde/wxbot project has always been developed in the GoLand integrated development environment under JetBrains. It is based on the free JetBrains Open Source license(s) authentic authorization. I would like to express my gratitude here.
The non-Hook version of the robot core is implemented by the openwechat SDK, and the maintenance has been suspended in nohook branch.
I'm using the Hook version of robot framework My Framework has run away , now use Qianxun , Dean DLL, for hook branch
The hook branch has borrowed a lot from the design scheme of a very excellent project ZeroBot-Plugin . Many of the basic codes come from ZeroBot-Plugin . On this basis, it has expanded the way to support wechat . Thanks♪(・ω・)ノ
AGPL-3.0 license. See the LICENSE file for details.