Skip to main content

use bilibili uid join in group

Project description

nonebot

nonebot_plugin_BiliRequestsBarand

已实现功能

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

使用方法

  • 使用pip
pip install nonebot_plugin_BiliRequestsBarand
  • 重新加载插件

说明依赖

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
                          ^^^^^^^^^^^^
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.2-py2.py3-none-any.whl (2.4 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_BiliRequestsBarand-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ba08d5ba59fe91f267a477b4d3152924562a1451d41b3a32bc20cf7140c22b13
MD5 f52060726fb5036d13fb3e0b8fbfbccf
BLAKE2b-256 6f4967118893a143a46df6527efa8d331b5c6d67a5560d4f7741195854452697

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