Giter Site home page Giter Site logo

embybot's Introduction

Bot 自定义命令菜单

私聊 @BotFather, Edit Bot - Edit Commands

help - [私聊]帮助
checkin - 签到
signup - 注册, 仅开放注册时使用
code - [私聊]使用注册码注册, 或者使用续期码续期。例: /code 123
del - [管理员]删除 Emby 账户, 需回复一个用户
me - [私聊]查看 Emby 账户 和 个人 信息(包含其它工具)
warn - [管理员]警告
info - [管理员]查看用户信息
settle - [管理员]手动结算积分
change - [管理员]手动修改积分, 正数加负数减

对于管理员: 使用 /signup 整数开启限额注册, /signup 时间(h m s)开启限时注册。例如: /signup 10;/signup 1h2m

功能

  • 积分管理
  • 用户管理
  • "码"
  • 字幕上传
  • 求片
  • 通知(半成品)

如何使用

  1. 数据库配置:新建一个数据库,安装程序启动时的提示填充数据库名, 操作数据库的用户名和密码, 数据库地址, 数据库端口 ,程序会自行创建数据库表

  2. 启动程序

apt install python3-full    # Debian/Ubuntu
git clone https://github.com/Gladtbam/EmbyBot.git
cd EmbyBot
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py

首次启动请务必执行 python main.py,根据程序提示填充配置

Systemd

vim /etc/systemd/system/embybot.service

[Unit]
Description=Emby Bot From EmbyHub by Gladtbam
After=network-online.target

[Service]
Type=simple
WorkingDirectory=/opt/EmbyBot/
Environment="PATH=/opt/EmbyBot/.venv/bin"
ExecStart=/opt/EmbyBot/.venv/bin/python3 /opt/EmbyBot/main.py
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

LoadConfig 程序配置解释

DataBase Host 数据库地址,默认localhost
Port 数据库端口,默认3066
User 可操作该数据库的用户的用户名
Password 密码
DatabaseName 数据库名
Telegram Token 机器人的Token,从@BotFather获取
ApiId API_ID和API_HASH,从https://my.telegram.org/apps 获取
ApiHash
BotName 机器人的用户名,比如@EdHubot
ChatID 聊天群组ID,比如-123456789
RequiredChannel 求片频道,比如@emby_hub_request
NotifyChannel 通知频道,比如@embyhub
Emby Host Emby 地址
ApiKey Emby API
Probe Host 哪吒探针
Token
Id
Other AdminId 机器人管理员的Telegram Id列表
OMDBApiKey OMDB
Ratio 注册积分=续期积分*Ratio
Wiki Wiki地址
Lidarr Host 音乐自动化(ToDo,未完成)
ApiKey
Radarr Host 电影自动化
ApiKey
Sonarr Host 剧集自动化
ApiKey
SonarrAnime Host 动画自动化
ApiKey

AdminId 存在BUG,其无法正常生成为列表,请自行修改为列表的格式,示例如下

other:
  AdminId:
    - 管理员1_ID
    - 管理员2_ID

求片功能依赖于Sonarr和Radarr

选择启用功能

该库并没有写功能选择的功能,但可以通过 注释装饰器 关闭不需要的功能:

示例关闭签到功能
# @client.on(events.NewMessage(pattern=fr'^/checkin({config.telegram.BotName})?$')) 

关闭定时积分结算
# @scheduler.scheduled_job('cron', hour='8,20', minute='0', second='0')

注册码、续期码

码的生成是通过时间戳加密指定字符串

在本服中,注册码的字符串是signup,续期码是renew,通过加密这两个字符串得到不同功能的码,使用时在将码解析回字符串来区分码的功能,因此,还可以加密其它字符串来做不同的功能

embybot's People

Contributors

dependabot[bot] avatar gladtbam avatar

Stargazers

K.Jing avatar  avatar  avatar  avatar stfghly avatar TobyLin avatar  avatar  avatar Pliwes avatar Ding Jiatong avatar  avatar Alan Umir avatar  avatar  avatar NozomiSuzumiya avatar  avatar  avatar  avatar  avatar EdNovas avatar  avatar  avatar

Watchers

 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.