[![GitHub stars](https://img.shields.io/github/stars/ghaoo/rboot?style=flat-square)](https://github.com/ghaoo/rboot) [![GitHub forks](https://img.shields.io/github/forks/ghaoo/rboot?color=green&style=flat-square)](https://github.com/ghaoo/rboot/fork) [![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/ghaoo/rboot?style=flat-square)](https://github.com/ghaoo/rboot) [![GitHub](https://img.shields.io/github/license/ghaoo/rboot?style=flat-square)](https://github.com/ghaoo/rboot)
[TOC]
# Rboot 助手机器人
```
===================================================================
* ________ ____ ____ ____ ______ ________ ____ ______ *
* ___/ __ \/ __ )/ __ \/ __ \/_ __/ ___/ __ )/ __ \/_ __/ *
* __/ /_/ / __ / / / / / / / / / __/ __ / / / / / / *
* _/ _ _/ /_/ / /_/ / /_/ / / / _/ /_/ / /_/ / / / *
* /_/ |_/_____/\____/\____/ /_/ /_____/\____/ /_/ *
* *
* Powerful and Happy *
===================================================================
```
***
## 介绍
Rboot是一个使用`golang`编写的,简单、高效的聊天机器人框架,易于扩展,它可以工作在不同的聊天服务上,通过扩展脚本以实现 `运维` 或 `办公` 自动化。
> github地址:[https://github.com/ghaoo/rboot](https://github.com/ghaoo/rboot)
Rboot面向的是`开发者`,他可分为四个模块:
1. `Adapter` 消息转接器
2. `Rule` 规则匹配器
3. `Script` 脚本解析函数
4. `Brain` 缓存器
> 当用户通过`消息转接器`将命令发送给机器人,机器人通过`规则匹配器`匹配命令,并将消息发送给对应`脚本`,`脚本`执行相应命令并将输出内容通过机器人发送给`消息转接器`,用户收到处理结果,这样就完成了一次命令的执行过程。
## 消息转接器
消息转接器 `Adapter` 是用来接入聊天系统,并监听输入输出的模块,已经简单实现了 `倍洽(bearychat)`,`微信网页版(wechat)`,`企业微信(wework)`,`钉钉(dingtalk)`,具体使用方法会在下面的文章里介绍。你也可以修改转接器以适应你自己的需求,或接入公司自己的聊天系统。
## 规则匹配器
规则匹配器现在只支持正则匹配
## 脚本解析函数
脚本解析函数 `Script` 是用来解析注册脚本的,当转接器传入消息时,`rboot` 通过规则匹配器匹配相应脚本和规则,执行对应的脚本函数。
## 缓存器
缓存器 `Brain` 像是机器人的大脑,它可以用来为你的机器人记忆数据,他实现了 `存储(set)`,`查找(get)`,`删除(remove)` 三个方法。