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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b52490b8ce81cf293dc9c5c3fcc9d1d96279ffcd861ad019b9ae0ae2a31f7b4 |
|
MD5 | 86ad4fe9953636dae8b42c0acf75d9e9 |
|
BLAKE2b-256 | cd1f4e19711a2fd0e7d6411265746cd9e02d5ab90fc106b3bdda442f5c763503 |
Close
Hashes for nonebot_plugin_bind-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6e47d59c624732b005101bed2b8cd687acdc8d0d6b9915bf5b513d521bc0bc7 |
|
MD5 | 22f1e1b7c295913d8f38f17e672f74e3 |
|
BLAKE2b-256 | eb54b55a7a5ca7279755113c68fb227b5fdb7b3e2d051a41229d5b276663c959 |