Skip to main content

插件描述

Project description

logo

✨ nonebot-plugin-user-perm ✨

LICENSE pypi python uv
ruff pre-commit

📖 介绍

设置群聊的某些普通用户使用插件的某个权限命令!

使用onebotv11适配器提供 isPermUser 函数给其他插件使用在响应器中

注意:isPermUser只接受群消息事件GroupMessageEvent

isPermUser 将判断这条消息发送人是否是该群聊设置的特定普通用户 + super用户

默认数据格式:{'super': [ ], 'group': { } }

例如:{'super': [12345], 'group': {'某个qq群号': [112233, 223344]}}
每个[ ]里填入普通用户的qq号(int类型)

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-user-perm --upgrade

使用 pypi 源安装

nb plugin install nonebot-plugin-user-perm --upgrade -i "https://pypi.org/simple"

使用清华源安装

nb plugin install nonebot-plugin-user-perm --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
uv
uv add nonebot-plugin-user-perm

安装仓库 master 分支

uv add git+https://github.com/dontdot/nonebot-plugin-user-perm@master
pdm
pdm add nonebot-plugin-user-perm

安装仓库 master 分支

pdm add git+https://github.com/dontdot/nonebot-plugin-user-perm@master
poetry
poetry add nonebot-plugin-user-perm

安装仓库 master 分支

poetry add git+https://github.com/dontdot/nonebot-plugin-user-perm@master

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

plugins = ["nonebot_plugin_user_perm"]
使用 nbr 安装(使用 uv 管理依赖可用)

nbr 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2

nbr plugin install nonebot-plugin-user-perm

使用 pypi 源安装

nbr plugin install nonebot-plugin-user-perm -i "https://pypi.org/simple"

使用清华源安装

nbr plugin install nonebot-plugin-user-perm -i "https://pypi.tuna.tsinghua.edu.cn/simple"

⚙️ 配置

使用nonebot-plugin-localstore持久化保存数据 可在 nonebot2 项目的.env文件中添加以下配置,使数据文件保存在bot项目下的data目录

LOCALSTORE_USE_CWD=True

🎉 使用

示例:在其他插件上使用

...
from nonebot import require
require("nonebot_plugin_apscheduler")
from nonebot_plugin_extrauserperm import isPermUser

weather = on_command("天气", permission=isPermUser)` 

or

...
from nonebot import require
require("nonebot_plugin_apscheduler")
from nonebot_plugin_extrauserperm import isPermUser

any_permission = SUPERUSER | GROUP_ADMIN | GROUP_OWNER | Permission(isPermUser)
weather = on_command("天气", permission=any_permission)

🎨 效果图

如果有效果图的话

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_user_perm-0.1.1.tar.gz (5.1 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_user_perm-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_user_perm-0.1.1.tar.gz.

File metadata

  • Download URL: nonebot_plugin_user_perm-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nonebot_plugin_user_perm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2369387b6d4f10ec1b79fe909734e2342adc5cb47067fde6c5cd36cc08ebc586
MD5 44034a0b5cc57d908ea14d7bd1d81c80
BLAKE2b-256 d574a0e9abfd29ea0b397173079e28af0a3d6ef5cfe3cc5a3b482cdbf5c1a64d

See more details on using hashes here.

File details

Details for the file nonebot_plugin_user_perm-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nonebot_plugin_user_perm-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nonebot_plugin_user_perm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b8c695d58a08994114e78d3390e9411f0d1aad06ca363d26523cb205f4b832ed
MD5 2935785af84be37d697069b272f35753
BLAKE2b-256 20ed73e8875044bc0c18a8af05eb6214556cb011de72ec0b1bb5d574f00f95d1

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