作用
通过patch on_command 和 on_alconna, 注入 SuperUserRule
- patch
on_command使bot只响应SuperUser的命令
从
nonebot.plugin.on import on_command导入的没法patch, 请使用nonebot.on_command导入
- patch
on_alconna使bot只响应SuperUser的消息 ExtensionExecutor.globals.append(OmbExtension), 判断是否为SuperUser的消息
安装方式
依赖管理
pip install nonebot-plugin-ombpoetry add nonebot-plugin-ombpdm add nonebot-plugin-omb
在
bot.py中添加nonebot.load_plugin("nonebot_plugin_omb")
⚠️ 请确保 nonebot_plugin_omb 加载优先级高于其他插件
配置项
必要配置项
# 在 nonebot-plugin-alconna>=0.53.0 版本中, 推荐配置(响应Bot的消息)
ALCONNA_RESPONSE_SELF=True
# 记得配置 SUPERUSERS
SUPERUSERS=["xxxxxx"]
依赖项
python = "^3.9"
nonebot2 = "^2.3.0"
nonebot-plugin-alconna = { version = ">=0.53.0", optional = true }
Metadata
Release files for nonebot-plugin-omb 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_omb-0.1.9.tar.gz | 4.1 kB | Without provenance | Details for nonebot_plugin_omb-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_omb-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_omb-0.1.9-py3-none-any.whl |
Total release size: 9.4 kB
Release files / nonebot_plugin_omb-0.1.9.tar.gz
| Download URL | nonebot_plugin_omb-0.1.9.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70e71503a9d451c9ee06e25e11d33d17edd5cd57e1e43919f9282330f90064b5
|
|
BLAKE2b-256 checksum How to use checksums |
1cd1568f7d489b8d7843e7628db11f812ec12c1bfb65b97eac7a1afe3faf6aa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.10.12 Linux/6.5.0-1025-azure
|
Release files / nonebot_plugin_omb-0.1.9-py3-none-any.whl
| Download URL | nonebot_plugin_omb-0.1.9-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ec4f1c145d1ea65c57ecab36c22ac11a7960781f380f912f8f7e857cceed6dd
|
|
BLAKE2b-256 checksum How to use checksums |
49279021bab192b19332963b71f9a4c920ce51d0c2caed7242d1798e4434d5e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.10.12 Linux/6.5.0-1025-azure
|
Security for nonebot-plugin-omb 0.1.9
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.