Skip to main content

NoneBotPluginText

nonebot-plugin-zxpm

✨ 基于 NoneBot2 的一个 插件管理插件 ✨

python nonebot onebot license

📖 介绍

小真寻 的插件权限管理系统,提供了

  • 细致的插件开关(全局关闭可以使用群白名单忽略)
  • Ban 群组/用户(消息屏蔽)
  • 插件 Cd,Count,Block 限制(配置文件)
  • 群管监测(权限自动设置)
  • 用户权限设置(超级用户设置)
  • 一个简单的帮助查看

继承了真寻的优良传统,高贵的超级用户不受权限控制,除非插件额外限制

💿 安装

pip install nonebot-plugin-zxpm
nb plugin install nonebot-plugin-zxpm

🎁 使用

⚙️ 配置

配置 类型 默认值 说明
zxpm_data_path str data/zxpm 数据存储路径
zxpm_db_url str (zxpm_data_path)/db/zxpm.db 数据库地址 URL,默认为 sqlite,存储路径在zxpm_data_path下
zxpm_notice_info_cd int 300 群/用户权限检测等各种检测提示信息 cd,为 0 时或永久 ban 时不提醒
zxpm_ban_reply str 才不会给你发消息. 用户被 ban 时回复消息,为空时不回复
zxpm_ban_level int 5 使用 ban 功能的对应权限
zxpm_switch_level int 1 使用开关功能的对应权限
zxpm_admin_default_auth int 5 群组管理员默认权限
zxpm_font str msyh.ttc 作图时字体
zxpm_limit_superuser bool False 是否限制超级用户

🎉 帮助

指令 格式 权限等级 参数 作用 示例
zxpm zxpm [名称] 0 -s 提供一个简单详情帮助图片 zxpm Ban: 查看 Ban 的用户帮助
zxpm Ban -s: 查看 Ban 的超级用户帮助
zxpm 40: 查看 id 为 40 的插件帮助(id 通过给 bot 发送插件列表获取)

权限设置

指令 格式 权限等级 参数 作用 示例
添加权限 添加权限 [level] [at] SUPERUSER 为用户提供插件管理等权限 添加权限 5 @user
删除权限 删除权限 [at] SUPERUSER 为用户提供插件管理等权限 删除权限 @user

白名单设置

指令 格式 权限等级 参数 作用 示例
添加群白名单 添加群白名单 ?[gid] SUPERUSER 标记群为白名单中 添加群白名单: 在群组中可以不加群号,默认当前群组
添加群白名单 123123: 指定群号
删除群白名单 删除群白名单 ?[gid] SUPERUSER 删除群为白名单中 同上

Ban/unBan

群组管理员

指令 格式 权限等级 参数 作用 示例
ban ban [At 用户] ?[-t [时长(分钟)]] 5 -t -g 屏蔽用户或群组消息,权限等级低无法 Ban 等级高的用户 ban @用户: 永久 ban
ban @用户 -t 10: ban 十分钟
unban unban [At 用户] 5 解除蔽用户或群组消息 @user unban @用户: 放出来

超级用户

ban [At用户/用户Id] ?[-t [时长]]
unban --id [idx]  : 通过id来进行unban操作
ban列表: 获取所有Ban数据

群组ban列表: 获取群组Ban数据
用户ban列表: 获取用户Ban数据

ban列表 -u [用户Id]: 查找指定用户ban数据
ban列表 -g [群组Id]: 查找指定群组ban数据
示例:
    ban列表 -u 123456789    : 查找用户123456789的ban数据
    ban列表 -g 123456789    : 查找群组123456789的ban数据

私聊下:
    示例:
    ban 123456789          : 永久拉黑用户123456789
    ban 123456789 -t 100   : 拉黑用户123456789 100分钟

    ban -g 999999              : 拉黑群组为999999的群组
    ban -g 999999 -t 100       : 拉黑群组为999999的群组 100分钟

    unban 123456789     : 从小黑屋中拉出来
    unban -g 999999     : 将群组9999999从小黑屋中拉出来

插件控制

群组管理员

格式:
开启/关闭[功能名称]   : 开关功能
开启/关闭所有插件     : 开启/关闭当前群组所有插件状态
醒来                 : 结束休眠
休息吧               : 群组休眠, 不会再响应命令

示例:
开启签到              : 开启签到
关闭签到              : 关闭签到

超级用户

插件列表
开启/关闭[功能名称] ?[-t ["private", "p", "group", "g"](关闭类型)] ?[-g 群组Id]

开启/关闭插件df[功能名称]: 开启/关闭指定插件进群默认状态
    = 开启插件echo -df
    = 关闭插件echo -df
开启/关闭所有插件df: 开启/关闭所有插件进群默认状态
开启/关闭所有插件:
    私聊中: 开启/关闭所有插件全局状态
    群组中: 开启/关闭当前群组所有插件状态

私聊下:
    示例:
    开启签到                : 全局开启签到
    关闭签到                : 全局关闭签到
    关闭签到 -t p           : 全局私聊关闭签到
    关闭签到 -g 12345678    : 关闭群组12345678的签到功能(普通管理员无法开启)

bot插件列表: bot插件列表状态  : bot插件列表
bot开启/关闭所有插件          : bot所有插件开关
bot开启/关闭插件[插件名称]    : bot插件开关
bot休眠                    : bot休眠,屏蔽所有消息
bot醒来                    : bot醒来

可修改配置文件

在(zxpm_data_path)/configs路径下有以 下 3 个配置文件,且文件中已提供参数解释
默认路径: data/zxpm/configs

  • plugin2block.yaml: 插件阻塞配置 例如:

    sign_in:
      status: true
      check_type: ALL
      watch_type: USER
      result: "你签那么快干什么啦"
    
  • plugin2cd.yaml: 插件 CD 配置 例如:

    sign_in:
      status: true
      check_type: ALL
      watch_type: USER
      result: 告辞
      cd: 12
    
  • plugin2count.yaml: 插件每日次数配置 例如:

      help:
        status: false
        watch_type: GROUP
        result: 再看就揍死你
        max_count: 2
    

❤ 感谢

  • 可爱的小真寻 Bot zhenxun_bot: 我谢我自己,桀桀桀

Metadata

Release files for nonebot-plugin-zxpm 0.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-zxpm 0.2.7
File Size Uploaded Provenance Actions
nonebot_plugin_zxpm-0.2.7.tar.gz 55.0 kB Without provenance Details for nonebot_plugin_zxpm-0.2.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-zxpm 0.2.7
File Interpreter ABI Platform Actions
nonebot_plugin_zxpm-0.2.7-py3-none-any.whl Python 3 none any Details for nonebot_plugin_zxpm-0.2.7-py3-none-any.whl

Total release size: 130.7 kB

Release files / nonebot_plugin_zxpm-0.2.7.tar.gz

Download URL nonebot_plugin_zxpm-0.2.7.tar.gz
Size 55.0 kB
Tags Source
SHA-256 checksum
How to use checksums
17dff4700a6833cb5605244082906a932eba18fa94aa1b00a3c58eb254240486
BLAKE2b-256 checksum
How to use checksums
7651e15e159536d6bb202a41cf7045097c5e73960e3aff8581428a584a9d9741
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.9 Windows/10

Release files / nonebot_plugin_zxpm-0.2.7-py3-none-any.whl

Download URL nonebot_plugin_zxpm-0.2.7-py3-none-any.whl
Size 75.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a52f9c507fb4bd7d539df8044719d7bf3476b451a0ef4ceeef1995f4ec487ff8
BLAKE2b-256 checksum
How to use checksums
8b6442f5f946896e6d46af3f9cacb899bd550ec935dd851eb499a4f08b0ab6e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.9 Windows/10

Security for nonebot-plugin-zxpm 0.2.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page