Skip to main content

use bilibili uid join in group

Project description

nonebot

nonebot_plugin_BiliRequestsBarand

已实现功能

  • 以B站UID审核入群(粉丝牌)

使用方法

  • 使用pip
pip install nonebot_plugin_BiliRequestsBarand
  • 点击DOWNLOAD ZIP
使用方法BiliRequest(barand)
  • 打开机器人目录下的 'pyproject.toml',一般是在第17行
17| plugin_dirs = ["XXX/XXX"]  <- XXX为插件的路径
##|               ^^^^^^^^^^^
  • 将下载的文件放入 XXX/XXX目录下

  • 重新加载插件

说明依赖

10| import json,time, requests
11| from nonebot import on_request, logger
12| from nonebot.adapters.onebot.v11 import Bot, GroupRequestEvent

注意事项

20| if event.group_id == <群号>: <- 直接替换成要使用的群号
##|                     ^^^^^^^
21|   raw = json.loads(event.json())
22|   gid = str(event.group_id)
23|   uid = str(event.user_id)
24|   flag = raw['flag']
27| comment = raw['comment']
28| BiliUID = ''.join(filter(str.isdigit,comment))
29| cookies = {"cookie": "<你的cookie>"}  <- 填入cookie
                          ^^^^^^^^^^^^

nonebot

34| # 同意入群
35| if '<粉丝牌子名>' in response: <- 直接替换成粉丝牌名
##|    ^^^^^^^^^^^^
36|   logger.info(f"同意{uid}加入群 {gid},验证消息为 “{comment}”")
37|   await bot.set_group_add_request(
38|     flag=flag,
39|     sub_type=sub_type,
40|     approve=True,
41|     reason=' ',
42|   )
43| # 拒绝入群
44| if '<粉丝牌子名>' not in response: <- 直接替换成粉丝牌名
##|    ^^^^^^^^^^^^
45|   logger.info(f"拒绝{uid}加入群 {gid},验证消息为 “{comment}”")
46|   await bot.set_group_add_request(
47|     flag=flag,
48|     sub_type=sub_type,
49|    approve=False,
50|     reason='未获得粉丝牌或未打开展示设置',
51|   )

未来计划

  • Tips:如果在不咕的情况下
    • 实现单插件分群管理
    • 实现切换审核模式(粉丝/持有粉丝牌/等)

反馈问题

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nonebot_plugin_BiliRequestsBarand-0.1.1-py2.py3-none-any.whl (2.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nonebot_plugin_BiliRequestsBarand-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_BiliRequestsBarand-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d10c71c50dc481fd6df68a0895b92d843af1025e72bf79dbddf70e6f444fb1a4
MD5 ded246368315d42251865e73b709baa0
BLAKE2b-256 6640356ff6391bdeafc4cc8cba9f926a990d8c8ffaef3e6bcf44073b3b8d4d99

See more details on using hashes here.

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