Entari 用户系统插件,用于统一管理用户信息、跨平台账号绑定和权限等级控制。
pip install entari-plugin-chronicle
# or use pdm
pdm add entari-plugin-chronicle
# or use uv
uv add entari-plugin-chronicle| 配置项 | 必填 | 默认值 |
|---|---|---|
| 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():
...koishijs/koishi: 提供权限管理规范he0119/nonebot-plugin-user:本项目直接参考