基于 Mirai Console 的 加群/好友 验证插件
使用前应该查阅的相关文档或项目
目前只实现了加群验证的功能
请确认 mcl.jar 的版本是 2.1.0+
./mcl --update-package xyz.cssxsh.mirai:mirai-authenticator --channel maven-stable --type plugin
配置验证条件, 目前 check 中 可选的 type 有 profile, question, bilibili, afdian
配置验证条件, 目前 validator 中 可选的 type 有 captcha
-
/auth-join check [group] {types}进群前检查
例如:/auth-join check 123456 profile question -
/auth-join validator [group] {types}进群后验证
例如:/auth-join validator 123456 captcha -
/auth-join official [id]设置自动放行的QQ号
例如:/auth-join official 123456789 -
/auth-join timeout [mills]问题回答等待时间
例如:/auth-join timeout 180000 -
/auth-join count [value]问题允许回答次数
例如:/auth-join count 5 -
/auth-join tip [message]验证码的提示
例如:/auth-join tip 请输入图片验证码的内容(不区分大小写) -
/auth-join place [group]加群请求失败交由管理员处理
例如:/auth-join place 123456
测试验证码功能
/auth-captcha会发送一张验证码并接受回答,以供测试
测试进群前检查功能
-
/auth-check question [group] [question] [answer]测试群的 question 验证脚本
group是群号,question是问题,answer是答案
例如:/auth-check question 123456 天王盖地虎 宝塔镇河妖 -
/auth-check profile [group] [target]测试群的 profile 验证脚本
group是群号,target是被测试的qq号
例如:/auth-check profile 123456 789566 -
/auth-check bilibili [group] [uid]测试群的 bilibili 验证脚本
group是群号,uid是入群提交的 uid
例如:/auth-check bilibili 123456 789566 -
/auth-check afdian [group] [uid]测试群的 afdian 验证脚本
group是群号,uid是入群提交的 uid
例如:/auth-check afdian 123456 dousha99
自定义验证分别在以下文件夹中
data/xyz.cssxsh.mirai.plugin.mirai-authenticator/profiledata/xyz.cssxsh.mirai.plugin.mirai-authenticator/questiondata/xyz.cssxsh.mirai.plugin.mirai-authenticator/bilibili
脚本文件名对应群号, 例如 123456.lua
Global variable (bindings) 支持的属性和方法有以下
botbot 对象eventId事件idgroupId群IDgroupName群名message请求消息invitorId邀请人fromId请求者IDfromNick请求者NICK
Profile 校验脚本主要用于校验用户的 Profile 信息
所以对于 Profile 校验脚本, 将支持
fromProfile请求者profilegetAge获取年龄getQLevel获取QQ等级getEmail获取右键getNickname获取昵称
例如,检查申请入群者的QQ等级是否大于4:
return fromProfile:getQLevel() > 4;Question 校验脚本主要用于校验用户提交的加群问题答案
所以对于 Question 校验脚本, 将支持
question问题answer回答
例如,检查答案是否满足要求:
return answer == "114514" or answer == "......";BiliBili 校验脚本主要用于校验用户提交的 UID 当前配置的粉丝牌详情
对于 BiliBili 校验脚本, 将支持
medal粉丝牌详情getTargetId获取主播UIDgetScore获取积分getLevel获取等级getGuardLevel获取舰长类型 (0 是非舰长)
例如, 检查是否佩戴了 哔哩哔哩音悦台#11153765 的粉丝牌,且为舰长 (等级大等于20) :
return medal:getTargetId() == 11153765 and medal:getLevel() >= 20;AFDian 校验脚本主要用于校验用户提交的 UID 是否在捐助者列表中
对于 AFDian 校验脚本, 将支持
query查询结果getList获取捐助者列表getUser获取捐助者信息getUserId获取捐助者 IDgetName获取捐助者 NAME
getCurrentPlan获取当前捐助计划getName获取捐助计划 NamegetStatus获取捐助状态getPrice获取捐助价格- ...
getFirstPayTime第一次支付时间getLastPayTime最后一次支付时间getAllSumAmount总计金额
getCount获取总数量getPage获取当前查询数量

