矩阵聊天机器人
chaanbot的Python项目详细描述
查恩博特
使用matrix-python-sdk的python 3matrix机器人。 bot是可扩展的,目前提供:
- 突出显示模块允许用户轻松通知用户组。 例如“!HL Javadevs Spring Boot vs Micronout?“会对javadevs组中的任何用户发出信号。
- 天气模块允许用户广播天气报告。
- 还有更多!
bot正在积极开发中,在创建一个稳定的版本之前,应该会出现严重的破坏性变化。
安装说明
chaanbot需要python 3。
为bot添加用户。不需要,但建议:
sudo adduser --disabled-password chaanbot
sudo su chaanbot
创建虚拟环境并安装bot及其依赖项:
python3 -m venv chaanbot
source chaanbot/bin/activate
python3 -m pip install chaanbot
启动bot初始化配置文件创建,然后根据需要编辑配置文件。 配置文件位置是由appdirs确定的用户配置目录,典型位置是:
Mac OS X: ~/Library/Application Support/chaanbot/chaanbot.cfg
Unix: ~/.config/chaanbot/chaanbot.cfg or in $XDG_CONFIG_HOME, if defined
Win *: C:\Users\<username>\AppData\[local or roaming]\chaanbot\chaanbot\chaanbot.cfg
运行bot的输出还将显示配置文件的位置:
chaanbot
nano .config/chaanbot/chaanbot.cfg
bot现在应该可以作为chaanbot用户运行:
chaanbot
为了方便起见,bot可以添加为服务。 使用sudo访问,将chaanbot.service文件复制到/etc/systemd/system/chaanbot.service:
sudo nano /etc/systemd/system/chaanbot.service
bot现在可从systemctl启动:
sudo service chaanbot start
并且可以设置为在启动时运行:
sudo systemctl enable chaanbot
升级版本
sudo su chaanbot
source /home/chaanbot/chaanbot/bin/activate
python3 -m pip install -U chaanbot
待办事项
- 改进错误处理
- 集成测试和更好的测试覆盖率
- 更多模块
- 改进非ubuntu 18.04安装的安装文档:-)
- 用诗歌来管理依赖关系?