nonebot多平台账户信息绑定
Project description
使用说明
用户使用说明
命令 | 限制 | 含义 |
---|---|---|
'bind' 或 '绑定' | 群聊或私聊 | 发起绑定事件 |
'bindinfo' 或 '绑定信息' | 仅私聊 | 查看账户绑定信息 |
具体使用请看下图流程示例
开发者说明
使用依赖注入获取用户信息的示例
from typing import Annotated
from nonebot import require
require('nonebot_plugin_bind')
from nonebot_plugin_bind import GetUser
_bind_info_ = on_command("bindinfo", aliases={"绑定信息"})
@_bind_info_.handle()
async def __(event: Event, bot: Bot, matcher: Matcher, user: Annotated[User, GetUser()]):
# 这里获取到的user可以访问属性来获取用户的具体账户信息,其中user.id是每个跨平台用户的唯一索引,也可以使用str()方法来转化成字符串
if _is_private_(event, bot):
await matcher.finish(f"当前账户的绑定信息如下:\n{str(user)}")
else:
await matcher.finish("账户绑定信息只能在私聊中查看")
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
Close
Hashes for nonebot_plugin_bind-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec15d3f9ba28b596eaccd4e5d8603d14ff94c349ad5936a257c659b9ccfaa8b9 |
|
MD5 | d1ec07c20ae9ceb201fce0cb1f1e17be |
|
BLAKE2b-256 | b23a6620d7a7c1a18a0db1f2922385e8079f1846e1845858b41755d7c44cbc00 |
Close
Hashes for nonebot_plugin_bind-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8596923a2f960fa16d9458551a454be864280b2d1ade8a97e7d5e3ebd86f80f6 |
|
MD5 | a28ecf5995bb4b6314a6df48bb03537c |
|
BLAKE2b-256 | 7946e98e8f92d08bda784ea866ff838d3222434a5a499a598fd70bc73c8866bc |