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_user_perm")
from nonebot_plugin_user_perm import isPermUser

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

or

...
from nonebot import require
require("nonebot_plugin_user_perm")
from nonebot_plugin_user_perm 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.3.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.3-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_plugin_user_perm-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 ac5b52ddee81b976a10383b07558c8c545d4ae4d188c0ef85d9900da1643b7ca
MD5 3fd0e9e0da0ddcd85e67ffa5d8855c99
BLAKE2b-256 d23b4e5607083a0cfa3182a78fe179e7b3a1acf31ae7b4d5e3d7c151cd414d89

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nonebot_plugin_user_perm-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 872ea85cf69de5111c6f69becd5e2f2444d8be6ee8d36be14c110685155a5dc4
MD5 c0c613703f5bb2171c3d0d19f9df8e85
BLAKE2b-256 ad93416b9905a16fa7e41aaeabde8411026bdecdb0cb79637cf551934b0c1156

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