适用于 Nonebot2 的用户插件
Project description
NoneBot Plugin User
✨ NoneBot 用户插件 ✨
简介
使用方式
加载插件后发送 /user 或 /bind。
查看用户信息
通过 user 命令可查看用户信息:
平台名:qq
平台 ID:10000
用户名:uy/sun
创建日期:2023-11-02 04:52:42
绑定用户
通过 bind 命令可将不同用户的数据绑定:
命令 bind 可用于在多个平台间绑定用户数据。绑定过程中,原始平台的用户数据将完全保留,而目标平台的用户数据将被原始平台的数据所覆盖。
请确认当前平台是你的目标平台,并在 5 分钟内使用你的账号在原始平台内向机器人发送以下文本:
/bind nonebot/123456
绑定完成后,你可以随时使用「bind -r」来解除绑定状态。
插件适配
先在插件代码最前面声明依赖
from nonebot import require
require("nonebot_plugin_user")
获取用户信息
from nonebot_plugin_user import User
@matcher.handle()
async def _(user: User):
await matcher.finish(user.id)
获取用户会话信息
from nonebot_plugin_user import UserSession
@matcher.handle()
async def _(session: UserSession):
await matcher.finish(session.platform_user.id)
配置项
配置方式:直接在 NoneBot 全局配置文件中添加以下配置项即可。
user_token_prefix
- 类型:
str - 默认:
nonebot/ - 说明: 生成令牌的前缀
计划
- 支持权限
鸣谢
- Koishi: 本项目直接参考
- nonebot-plugin-session: 获取用户信息
- nonebot-plugin-uninfo: 通用的会话信息插件
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_user-0.5.3.tar.gz.
File metadata
- Download URL: nonebot_plugin_user-0.5.3.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67288a0badd775af693d95eb2cbe6924925ad5f24b94b72afde6e0376c01506a
|
|
| MD5 |
38761223f70740bc7219056ee5e66067
|
|
| BLAKE2b-256 |
32ca7951643c4862c004ed00026dc11e0495d45f0294654277d0ee07fe4d3245
|
Provenance
The following attestation bundles were made for nonebot_plugin_user-0.5.3.tar.gz:
Publisher:
release.yml on he0119/nonebot-plugin-user
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_user-0.5.3.tar.gz -
Subject digest:
67288a0badd775af693d95eb2cbe6924925ad5f24b94b72afde6e0376c01506a - Sigstore transparency entry: 389325491
- Sigstore integration time:
-
Permalink:
he0119/nonebot-plugin-user@6685910ea2b377269851e87749f4101a8f5ebf3d -
Branch / Tag:
refs/tags/v0.5.3 - Owner: https://github.com/he0119
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6685910ea2b377269851e87749f4101a8f5ebf3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file nonebot_plugin_user-0.5.3-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_user-0.5.3-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c41ff5c3bf3f9b1a5e9ffd73ef4df61876a2b0a32e52ecca5c60103cf4e23118
|
|
| MD5 |
10932a945d04ab061c98084cbe795ceb
|
|
| BLAKE2b-256 |
6681dd9f976fe7175554aea2f36b51c5f1e6e34845d0a8899403a46f1e3ff1bd
|
Provenance
The following attestation bundles were made for nonebot_plugin_user-0.5.3-py3-none-any.whl:
Publisher:
release.yml on he0119/nonebot-plugin-user
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_user-0.5.3-py3-none-any.whl -
Subject digest:
c41ff5c3bf3f9b1a5e9ffd73ef4df61876a2b0a32e52ecca5c60103cf4e23118 - Sigstore transparency entry: 389325505
- Sigstore integration time:
-
Permalink:
he0119/nonebot-plugin-user@6685910ea2b377269851e87749f4101a8f5ebf3d -
Branch / Tag:
refs/tags/v0.5.3 - Owner: https://github.com/he0119
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6685910ea2b377269851e87749f4101a8f5ebf3d -
Trigger Event:
push
-
Statement type: