Skip to main content

nonebot

NoneBot Plugin User

✨ NoneBot 用户插件 ✨

license pypi python codecov QQ Chat Group

简介

使用方式

加载插件后发送 /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/
  • 说明: 生成令牌的前缀

鸣谢

Metadata

Release files for nonebot-plugin-user 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-user 0.6.1
File Size Uploaded Provenance Actions
nonebot_plugin_user-0.6.1.tar.gz 11.5 kB With provenance Details for nonebot_plugin_user-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-user 0.6.1
File Interpreter ABI Platform Actions
nonebot_plugin_user-0.6.1-py3-none-any.whl Python 3 none any Details for nonebot_plugin_user-0.6.1-py3-none-any.whl

Total release size: 27.3 kB

Release files / nonebot_plugin_user-0.6.1.tar.gz

Download URL nonebot_plugin_user-0.6.1.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e50d78b6f1a33c9fa9a47c5cdad1b3cee1bc04565de8d3058d3fde794ad376e0
BLAKE2b-256 checksum
How to use checksums
6376bc28a7e1a4f14dac66f2d5a4da6923b0c4f8f46e79b9b1e21029a56971db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.

Transparency log

Release files / nonebot_plugin_user-0.6.1-py3-none-any.whl

Download URL nonebot_plugin_user-0.6.1-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57e322e62a3930e42ffddfdce1921c18d5470571096e7967f5bd41f43a8abe15
BLAKE2b-256 checksum
How to use checksums
bb615f6d375f7ffb619be23ba1e06f10179fbfa61c0b569ca0a683a51b8c1b52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.

Transparency log

Security for nonebot-plugin-user 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nonebot_plugin_user-0.6.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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