Skip to main content

use bilibili uid join in group

Project description

nonebot

nonebot_plugin_BiliRequestBarand

已实现功能

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

使用方法

  • 使用pip
pip install nonebot_plugin_BiliRequestBarand
  • 点击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 Distribution

Built Distribution

File details

Details for the file nonebot_plugin_BiliRequestsBarand-0.1.0.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_BiliRequestsBarand-0.1.0.tar.gz
Algorithm Hash digest
SHA256 14ca4aabba7b7a785461b3d7916270a6f322d10c5194be4eee5e72f1cdcd8dfc
MD5 75857a0cda096d05417ab6ba04d163f4
BLAKE2b-256 d4826dd35ba579af934038fd5eeb43b10077bb2a7f4b91fdcda1d63ac14134f1

See more details on using hashes here.

File details

Details for the file nonebot_plugin_BiliRequestsBarand-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_BiliRequestsBarand-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64c8834cc81f920b573da462a1d17596f82a936bc8f52223ea3a7c4a11629b01
MD5 85fd536323d50dae910a338eae34ea40
BLAKE2b-256 588bab89dce18966fade779a7e6d146d14e75d14e81f9435c0a2afb97ccf9c77

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