Coder Social home page Coder Social logo

emby_bot's Introduction

embybot - 针对Emby公益服的开服机器人,实现功能如下:

  • 通过机器人创建Emby账号,并同步设置好账号的相关权限-全员可用
  • 通过指令重置Emby账户密码,自定义设置账户密码-全员可用
  • 通过指令查询账户用户名-全员可用
  • 通过指令添加服务器线路信息-管理员可用
  • 通过指令查询公益服账户注册总数-管理员可用
  • 通过指令查询公益服服务器负载状态-全员可用

使用方法

  • 拉取项目
git clone https://github.com/07031218/emby_bot.git && cd emby_bot
  • 修改项目根目录的.env文件,填写TG机器人的API-TOKEN;

  • 修改项目根目录的config.py文件,根据注释提示填写好相关数据;

  • phpmyadmin中新建数据库,导入项目中的mysql.sql恢复数据,数据表users记录存储Emby注册用户的相关数据,line数据表记录存储服务器线路信息,severs数据表可用来存储记录其他服emby服务器的相关信息;

  • 回到项目根目录,执行pip3 install -r requirements.txt安装所需的相关依赖;

  • 完成以上动作之后,执行python3 bot.py启动机器人

机器人指令大全:

  • /add_code - 添加公益服邀请码

  • /invite - 通过邀请码注册账号

  • /create - 注册公益服账户

  • /account - 查询公益服用户名

  • /reset - 重置公益服密码

  • /setpw - 自定义公益服账户密码

  • /checkurl - 查询公益服线路信息

  • /counts - 查询公益服账户总数

  • /addurl - 添加公益服线路信息

  • /addserver - 添加群友公益服信息

  • /checkserver - 查询群友公益服信息

  • /status - 查询公益服负载情况(需要配合哪吒探针自行修改对应代码,代码在checkname.py文件中)

  • /total - 查询公益服影片数量

机器人进程守护可通过添加systemd服务来实现

cat >/etc/systemd/system/emby_bot.service <<EOF
[Unit]
Description=emby_bot
After=rc-local.service

[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/root/emby_bot/ # 填写embybot目录路径
ExecStart=/usr/bin/python3 bot.py
Restart=always

[Install]
WantedBy=multi-user.target
EOF
  • 启动服务
systemctl start emby_bot
  • 设置开机启动
systemctl enable emby_bot
  • 机器人运行状态查看
systemctl status emby_bot

emby_bot's People

Contributors

07031218 avatar

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.