https://github.com/xiaofeige/wechat-work-bot
企业微信群聊机器人基础库
https://github.com/xiaofeige/wechat-work-bot
bot wechat wechat-work weixin
Last synced: 5 months ago
JSON representation
企业微信群聊机器人基础库
- Host: GitHub
- URL: https://github.com/xiaofeige/wechat-work-bot
- Owner: xiaofeige
- License: gpl-3.0
- Created: 2020-10-15T15:39:25.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-19T06:28:37.000Z (almost 5 years ago)
- Last Synced: 2025-04-02T02:41:21.647Z (about 1 year ago)
- Topics: bot, wechat, wechat-work, weixin
- Language: Go
- Homepage:
- Size: 48.8 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wechat-work-bot
企业微信群聊机器人库
## 功能特性
无需再去看微信文档实现对应的接口,加解密也都帮你实现了。import之后,只需要实现一个handler处理各种消息,然后注册到机器人中即可。
支持注册多个机器人,通过robot id区分。也就是申请的机器人回调中的key的值。
## How to use
```
go get github.com/xiaofeige/wechat-work-bot
```
## example
参考`example`目录下的实现
```
// create handler which implement the wx callback msg handler
type ExampleHandler struct{
*BaseHandler
}
// 覆盖默认的事件响应函数
func (h *ExampleHandler)OnMsgRecv(ctx context.Context, msg *CallBackReq) (rsp *CallBackRsp, err error){
return &CallbackRsp{}, nil
}
```
添加handler到机器人
```
h := &ExampleHandler{}
robot, err := wechat_work_bot.NewWxWorkRobot(conf.RobotConf)
if err != nil{
fmt.Println("error")
return
}
robot.AddHandler(h)
robot.Start()
```
## 如何添砖加瓦
希望我们的合作模式是 fork&pull-request