Skip to main content

Entari 用户插件

Project description

entari-plugin-user

python pypi

Entari 用户系统插件,用于统一管理用户信息、跨平台账号绑定和权限等级控制。

安装

pip install entari-plugin-user
# or use pdm
pdm add entari-plugin-user
# or use uv
uv add entari-plugin-user

配置

配置项 必填 默认值
user_token_prefix entari/

使用

查看用户信息

/user

改名

/user -n <username>
/callme <username>

绑定

/bind [-r|--revoke]

授权

[!NOTE] 本项目的权限管理了参考 Koishi 的方案
我们也推荐开发者按照其标准进行管理

  • 1 级:所有用户,只能够接触有限的功能
  • 2 级:高级用户,能够接触几乎一切机器人的功能
  • 3 级:管理员,能够直接操作机器人事务
  • 4 级:高级管理员,能够管理其他账号
  • 5 级:超级管理员(SUPERUSER)
/auth <level> -u <@用户>
/auth --superuser [token]

插件适配

获取用户信息

from arclet.entari import command
from entari_plugin_user import User, UserSession  # entari:plugin

@command.on("me")
async def _(session: UserSession):
    await session.send(f"You're {session.user_name}({session.platform_id})")

权限过滤

from arclet.entari import command, propagate
from entari_plugin_user import Authorization, only_superuser  # entari:plugin

@command.on("ban")
@propagate(Authorization(3))
async def _ban():
    ...

@command.on("sudo")
@only_superuser
async def _sudo():
    ...

鸣谢

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

entari_plugin_user-0.1.5.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

entari_plugin_user-0.1.5-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file entari_plugin_user-0.1.5.tar.gz.

File metadata

  • Download URL: entari_plugin_user-0.1.5.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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 entari_plugin_user-0.1.5.tar.gz
Algorithm Hash digest
SHA256 f5371a198831c66e1b16b8cb231e3d7a7cffcecd72c2146fdf6c23dc637fecac
MD5 1cd125bbcf086b7443b81784fedf1cf6
BLAKE2b-256 e19b8aa5524b561895a05a3308a5e7375c358cd4608648408867359445b9e7ca

See more details on using hashes here.

File details

Details for the file entari_plugin_user-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: entari_plugin_user-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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 entari_plugin_user-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 47ce75ed65937a817240bf53b916e74da95d94e2aff2cf21517d0091578cc5d0
MD5 103d02c811869b2fa3fc4e64f756cb02
BLAKE2b-256 2fa973a2719fe90287f6a0488a0bc944dae25176e26408180771c9f535194df7

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