golang版个人微信号API, 突破网页版限制,类似开发公众号一样,开发个人微信号

eatmoreapple · · 2385 次点击 · 开始浏览    置顶
这是一个创建于 的主题,其中的信息可能已经有所发展或是发生改变。

# openwechat [![Go Doc](https://pkg.go.dev/badge/github.com/eatMoreApple/openwechat)](https://godoc.org/github.com/eatMoreApple/openwechat) > golang版个人微信号API, 突破网页版限制,类似开发公众号一样,开发个人微信号 微信机器人:smiling_imp:,利用微信号完成一些功能的定制化开发⭐ * 支持定制化开发,如日志记录,自动回复 * 突破网页版登录限制&#x1F4E3; * 无需重复扫码登录 * 支持多个微信号同时登陆 ### 安装 `go get` ```shell go get github.com/eatmoreapple/openwechat ``` ### 快速开始 ```go package main import ( "fmt" "github.com/eatmoreapple/openwechat" ) func main() { bot := openwechat.DefaultBot() // bot := openwechat.DefaultBot(openwechat.Desktop) // 桌面模式,上面登录不上的可以尝试切换这种模式 // 注册消息处理函数 bot.MessageHandler = func(msg *openwechat.Message) { if msg.IsText() && msg.Content == "ping" { msg.ReplyText("pong") } } // 注册登陆二维码回调 bot.UUIDCallback = openwechat.PrintlnQrcodeUrl // 登陆 if err := bot.Login(); err != nil { fmt.Println(err) return } // 获取登陆的用户 self, err := bot.GetCurrentUser() if err != nil { fmt.Println(err) return } // 获取所有的好友 friends, err := self.Friends() fmt.Println(friends, err) // 获取所有的群组 groups, err := self.Groups() fmt.Println(groups, err) // 阻塞主goroutine, 直到发生异常或者用户主动退出 bot.Block() } ``` ### 支持功能 * 消息回复、给指定对象(好友、群组)发送文本、图片、文件、emoji表情等消息 * 热登陆(无需重复扫码登录)、自定义消息处理、文件下载、消息防撤回 * 获取对象信息、设置好友备注、拉好友进群等 * 更多功能请查看文档 ### 文档 [点击查看](https://openwechat.readthedocs.io/zh/latest/) ### 项目主页 [https://github.com/eatmoreapple/openwechat](https://github.com/eatmoreapple/openwechat) ### 添加微信:apple:(备注: openwechat),进群交流:smiling_imp: <img width="210px" src="https://raw.githubusercontent.com/eatmoreapple/eatMoreApple/main/img/wechat.jpg" align="left">

有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

2385 次点击  ∙  5 赞  
加入收藏 微博
8 回复  |  直到 2021-09-16 23:48:55
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传