Skip to main content

nonebot多平台账户信息绑定

Project description

nonebot_plugin_bind

pypi python pypi

适配支持

  • onebotv11
  • telegram
  • discord
  • kook(开黑啦)
  • villa(大别野)
  • 飞书

使用说明

用户使用说明

命令 限制 含义
'bind' 或 '绑定' 群聊或私聊 将其他通用账户绑定至当前通用账户
'bindinfo' 或 '绑定信息' 仅私聊 查看当前通用账户的平台账户绑定信息
'rebind' 或 '取消绑定' 仅私聊 取消本平台账户和通用账户的绑定,并形成一个新的通用账户

具体使用请看下图流程示例
(如果是在群聊中发起的绑定,不会显示下面的绑定信息,只会显示其他内容)
使用qq发送bind命令
使用discord发送bind命令和token
使用qq发送密钥确认绑定
取消绑定

开发者说明

使用依赖注入获取用户信息的示例
注入后获得的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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_bind-0.1.4.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

nonebot_plugin_bind-0.1.4-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page