nonebot多平台账户信息绑定
Project description
适配支持
- onebotv11
- telegram
- discord
- kook(开黑啦)
- villa(大别野)
- 飞书
使用说明
用户使用说明
命令 | 限制 | 含义 |
---|---|---|
'bind' 或 '绑定' | 群聊或私聊 | 将其他通用账户绑定至当前通用账户 |
'bindinfo' 或 '绑定信息' | 仅私聊 | 查看当前通用账户的平台账户绑定信息 |
'rebind' 或 '取消绑定' | 仅私聊 | 取消本平台账户和通用账户的绑定,并形成一个新的通用账户 |
具体使用请看下图流程示例
(如果是在群聊中发起的绑定,不会显示下面的绑定信息,只会显示其他内容)
开发者说明
使用依赖注入获取用户信息的示例
注入后获得的user是一个通用账户的class,其属性id是可以用来区分不同通用账户的唯一值,另一个属性platform_users储存通用账户绑定的所有的平台账户的信息
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 _bind_info____(event: Event, bot: Bot, matcher: Matcher, user: Annotated[User, GetUser()]):
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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e27d342b02319b2caea113df0542517a5090c556eb36ef0fad456e31542faf3 |
|
MD5 | 9fcd9b8a195744c15e3796cfbc8c37e5 |
|
BLAKE2b-256 | 3f2f4406c5ad46b44c8ef188615a61b222fd2e7e0a01bc965daf7c5ada6dabe0 |
Close
Hashes for nonebot_plugin_bind-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79c8ebf4343cbd04f2496f1d67b4361f3a28e0df6a702cef20dcd6cc06b68cef |
|
MD5 | 17fec93f1ab7bde69a9521715b1fab01 |
|
BLAKE2b-256 | 6ee923592c4abcb9f99337912ed60240224f2de9338a9920ec36e6487801e7f2 |