Skip to main content

Message Blocker

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-blocker

✨ NoneBot Plugin Blocker ✨

license pypi python pypi download

📖 介绍

这是一个 nonebot2 插件项目,用于分群配置机器人的开启关闭

插件提供了一个简单的WebUI来让你配置Bot的开关指令以及对指令做出的回复。

💿 安装

使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-blocker

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_blocker"]

⚙️ 配置

请注意,使用<0.3.1版本的更新之后请重新在WebUI里进行配置

>0.3.1,<0.3.3的请更新到0.3.3来自动更新配置项或者更新之后手动重新在WebUI里配置

常规配置项,位于.env文件里

#WebUI的登录凭证,不设置即不进行验证
BLOCKER_WEBUI_USERNAME=""
BLOCKER_WEBUI_PASSWORD=""

其他配置项

插件的回复配置文件位于 data/blocker/config.json 里,不建议手动更改

data/blocker/blocklist.json 里是已经设置关闭Bot的群号,可以在关闭nonebot之后手动编辑

💬 指令

指令只有管理员,群主以及Bot的SUPERUSER能够使用

.bot on在该群开启bot

.bot off在该群关闭bot

在上述指令后at特定bot将关闭使用了本插件的特定Bot,不会影响使用本插件的其他Bot

如果你在WebUI设置了指令|回复那么指令|回复将会是你设置的文本

TODO && 碎碎念

  • 非常感谢各位写过nonebot2插件的前辈(
  • 因为有些代码懒得自己手写拿来改改用了(((
  • 准备接着改改配置项(现在就这样吧,如果nonebot有更新Pydantic的打算的话再进一步做)
  • 什么时候用上PydanticV2啊我要用RootModel啊(
  • 明明准备把代码改漂亮点的结果越写越丑,乐了

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_blocker-0.3.4.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_blocker-0.3.4-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_blocker-0.3.4.tar.gz.

File metadata

  • Download URL: nonebot_plugin_blocker-0.3.4.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.8.2 CPython/3.10.6

File hashes

Hashes for nonebot_plugin_blocker-0.3.4.tar.gz
Algorithm Hash digest
SHA256 013faaf37ce19ebe897713bdd8b9ec1759ccc9374bf59081da4266e4c90d2d4f
MD5 b152cbaae894f8f56a53c28f01f52538
BLAKE2b-256 6bbe1c4ca21faa98dfb092f25212b303c6a3ff2022a472f0f284762a56f3ac84

See more details on using hashes here.

File details

Details for the file nonebot_plugin_blocker-0.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_blocker-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 af4a07c5136f3b05ec3c7d66b5bd3dd60e25fc870f13e6cb0783ab3baf322ad9
MD5 68effaa51fdaae0e4221d541154f92a2
BLAKE2b-256 b3b279ce5829cf01f5fe9fce4b1dc3c9ca38b4fb58d37fad5fa2800587fd7c2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page