go version wechat web api and message framework for building wechat robot
go version wechat web api and message framework for building wechat robot
微信web版API的go实现,模拟微信网页版的登录/联系人/消息收发等功能,可以完全接管微信收到的消息, 并定制自己的发送内容
mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/net.git
go get -u -v github.com/songtianyi/wechat-go
cd $GOPATH/src/github.com/songtianyi/wechat-go
go get ./...go build examples/linux/terminal_bot.go
./terminal_botwindows版本需要在非windows系统使用交叉编译来生成, 生成之后在windows下运行
GOOS=windows GOARCH=amd64 go build examples/windows/windows_bot.go
./windows_bot.exe
扫码图片需要用软件打开,路径在输出日志内.…一个管理插件的插件
#关闭某个插件, 在微信聊天窗口输入
disable faceplusplus
#开启某个插件, 在微信聊天窗口输入
enable faceplusplus
#查看所有插件信息, 在微信聊天窗口输入
dump对收到的图片做面部识别,返回性别和年龄
以收到的文字消息为关键字做gif搜索,返回gif图, 注意返回的gif可能尺度较大,比如文字消息中包含“污”等关键词。
对收到的文字/图片消息,做自动应答,回复固定文字消息
随机获取一张美女图片, 在聊天窗口输入
美女获取一则笑话, 在聊天窗口输入
笑话消息撤回插件, 3s后自动撤回手机端所发的文本消息. 机器人发出的消息需要自己在对应插件里写撤回逻辑.
处理消息撤回/红包等系统提示
消息跨群转发, 在插件里修改群名的全拼即可.
中英互译插件, 基于有道翻译API
自动接受好友请求, 可以按条件过滤
资源(纸牌屋)自动分发示例
配置管理插件 设置配置, 在聊天窗口输入
set config key value查看配置,在聊天窗口输入
get config key在代码中使用配置
import "github.com/songtianyi/wechat-go/kv"
func demo() {
kv.KVStorageInstance.Set("key", "value")
v := kv.KVStorageInstance.Get("key")
if v == nil {
return
}
// v.(string) etc.
}自定义插件的两个原则
插件示例
…No open issues yet, or sync has not completed.