Skip to main content

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 的方案
我们也推荐开发者按照其标准进行管理

  • 0 级:黑名单用户,机器人不会响应其指令
  • 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, superusers  # entari:plugin

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

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

鸣谢

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.2.0.tar.gz (9.7 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.2.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: entari_plugin_user-0.2.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.2.0.tar.gz
Algorithm Hash digest
SHA256 3ad727139beb99ad5d1dec4f6b68529fb9bf93445f6dd0657fe4920a5b52fcf1
MD5 b90ea366aa4578fb0a09216150c3341f
BLAKE2b-256 9982231f6ab9be3791b928a7083954e33150315fc286962086e54b333b031aa2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: entari_plugin_user-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 272467eb04ac21d980b0bce3863915bdc39dc9a05980bf99437985a5e5a41973
MD5 5fe22906bed05784e8f33331aaf4acca
BLAKE2b-256 1b484c8e57eaeeff25451a30830dd54a7b03ba4b73757a7ce2789f0b2d661aa3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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