Skip to main content

ohh my bot!

Project description

nonebot

NoneBot Plugin OMB

Ohh My Bot!

License Python NoneBot

作用

通过patch on_commandon_alconna, 注入 SuperUserRule

  • patch on_command 使 bot 只响应 SuperUser 的命令

nonebot.plugin.on import on_command 导入的没法patch, 请使用 nonebot.on_command 导入

  • patch on_alconna 使 bot 只响应 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 版本中, 推荐配置
ALCONNA_RESPONSE_SELF=True

# 记得配置 SUPERUSERS
# 仅测试下面这种配置方式
SUPERUSERS=["xxxxxx"]

依赖项

python = "^3.9"
nonebot2 = "^2.3.0"
nonebot-adapter-onebot = "^2.1.0"
nonebot-plugin-alconna = { version = ">=0.53.0", optional = true }

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_omb-0.1.8.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

nonebot_plugin_omb-0.1.8-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_omb-0.1.8.tar.gz.

File metadata

  • Download URL: nonebot_plugin_omb-0.1.8.tar.gz
  • Upload date:
  • Size: 3.9 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

Hashes for nonebot_plugin_omb-0.1.8.tar.gz
Algorithm Hash digest
SHA256 439ac4071dfe41be6646a6166a5e588db800ad2a8f38f6fa0b5859d497d598bd
MD5 f9076442ba74f7f12b26f983fdba16ec
BLAKE2b-256 55d40fe14014b8298ffd0cfb863d59595aba61eec2386a6f0843a15f6bf2347a

See more details on using hashes here.

File details

Details for the file nonebot_plugin_omb-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_omb-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d4e1353141d62e9e1a003cd2f53379a33c66cf239c376a11d056d12ba2fb367f
MD5 62f69dd509c9816fafc60518fd815dd6
BLAKE2b-256 f5e9a9f1f53c61e84525a47fae37661c0d0c4de81f38dc3bd8c0b95b97ef8bb7

See more details on using hashes here.

Supported by

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