ohh my bot!
Project description
NoneBot Plugin OMB
Ohh My Bot!
作用
通过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 }
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_omb-0.1.9.tar.gz.
File metadata
- Download URL: nonebot_plugin_omb-0.1.9.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70e71503a9d451c9ee06e25e11d33d17edd5cd57e1e43919f9282330f90064b5
|
|
| MD5 |
2458590518b1cf53f048bc7fcedb6d8c
|
|
| BLAKE2b-256 |
1cd1568f7d489b8d7843e7628db11f812ec12c1bfb65b97eac7a1afe3faf6aa0
|
File details
Details for the file nonebot_plugin_omb-0.1.9-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_omb-0.1.9-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ec4f1c145d1ea65c57ecab36c22ac11a7960781f380f912f8f7e857cceed6dd
|
|
| MD5 |
915b57dcf07e5cc33e92e8caa8067492
|
|
| BLAKE2b-256 |
49279021bab192b19332963b71f9a4c920ce51d0c2caed7242d1798e4434d5e7
|