Git Product home page Git Product logo

maotaiwangwangbot's Introduction

MaotaiWangWangBot

毛台汪汪机器人是从毛台Bot项目中独立出来的一个项目。

这个项目的目的就是建立一个Bot能远程管理你的Linux、MacOS或是类似的系统。

你可以使用 /setcmd来设置 /admin 出来的命令操作列表。 setcmd 后面的是一个数组,至少是一个三维数据,最外层是行,然后是行里的button,然后是['button_name','shell']这样。

最终的效果如图:

image

支持的命令

  • /setcmd 设置可以执行的cmd,格式方便读取就好,也许是 [[name,shell],[name,shell]....] ,它会存到config.json中去
  • /showcmd 显示已经设置的可执行cmd,显示出的格式与setcmd 的格式相同
  • /admin 列出可以执行的cmd,按button,用以执行对应的cmd
  • /zy 记录下一个人提交的作业到一个单独的json文件里,需要记录下 uid/FirstName/日期/messageid。记录过去七天的历史,超过的历史在存时去除掉。
  • /lzy/lzy MMDD 列出当天或指定日期交的作业,每行一个 FirstName messagelink
  • /kzy 将过去N天没有交作业的从指定的[chatid,chatid]里踢除,配置存在config.json里
  • zy 支持在config中配置zychat:[chatid, chatid], 不同chat的作业,分开进行存放。

配置文件

配置文件为 config.json

{
    "Token": "YOUR_TOKEN",
    "Admin":[ USER_ID,USER_ID ]
}

安装

编辑 maotaiwangwangbot_service.service 中的python路径和adminbot.py的路径后安装service。

python -m venv py3
mkdir -p ~/.config/systemd/user
cp shell/maotaiwangwangbot_service.service ~/.config/systemd/user
systemctl --user daemon-reload
sudo loginctl enable-linger $USER
systemctl --user start maotaiwangwangbot_service
systemctl --user enable maotaiwangwangbot_service

maotaiwangwangbot's People

Contributors

coolsoybean avatar hdcola avatar leexia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

maotaiwangwangbot's Issues

增加sqlite存储数据能力

需求:现阶段一些数据存储在本地一个json文件,编写程序阶段需要知道存储位置和json的详细结构,加个sqlite存储数据的能力

提供一个通用接口通过id,type进行数据query,通过id,type,string进行数据put

zycmd.py 小问题#1

message.reply_to_message.photo == None and message.reply_to_message.document == None

无图片的时候message.reply_to_message.photo 总是[],不是None。

dzy_cmd 的问题

           msgid = context.args[0]
            for uid, zy in all_zys.items():
                for _zy in zy.get('ZY', []):
                    mid = _zy['MESSAGEID'].split("/")[-1]

msgid 出来的是日期,mid对应的是链接的消息id,貌似匹配不到一起?

lzy_cmd 小问题#2

_command = update.effective_message.text.split("/lzy ")

群里面命令后面会带 @bot, 这样这里就没有办法按照/lzy来split消息。

如果在群里/lzy是不是应该显示发送消息的人的作业,而不是所有人提交的信息?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.