Skip to main content

nonebot

NoneBot Plugin OMB

Ohh My Bot!

License Python NoneBot

作用

通过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-omb
  • poetry add nonebot-plugin-omb
  • pdm 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)

Source distribution for nonebot-plugin-omb 0.1.9
File Size Uploaded
nonebot_plugin_omb-0.1.9.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-omb 0.1.9
File Interpreter ABI Platform
nonebot_plugin_omb-0.1.9-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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