{"id":15659235,"url":"https://github.com/cssxsh/mirai-authenticator","last_synced_at":"2025-05-05T17:37:58.313Z","repository":{"id":63090825,"uuid":"565209404","full_name":"cssxsh/mirai-authenticator","owner":"cssxsh","description":"Mirai Console 验证插件 ","archived":false,"fork":false,"pushed_at":"2024-11-27T09:49:47.000Z","size":473,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T22:41:31.514Z","etag":null,"topics":["auth","mirai","mirai-console"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cssxsh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-12T17:17:14.000Z","updated_at":"2024-11-27T09:46:54.000Z","dependencies_parsed_at":"2024-10-23T06:23:09.120Z","dependency_job_id":"3b45c4cb-2ceb-437c-b52e-30519b17b9a5","html_url":"https://github.com/cssxsh/mirai-authenticator","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"f4d2cd1c29bc372d1c054384db11d09609b99ab3"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Fmirai-authenticator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Fmirai-authenticator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Fmirai-authenticator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Fmirai-authenticator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cssxsh","download_url":"https://codeload.github.com/cssxsh/mirai-authenticator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252543774,"owners_count":21765218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auth","mirai","mirai-console"],"created_at":"2024-10-03T13:15:52.341Z","updated_at":"2025-05-05T17:37:58.292Z","avatar_url":"https://github.com/cssxsh.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mirai Authenticator\n\n\u003e 基于 Mirai Console 的 加群/好友 验证插件 \n\n[![Release](https://img.shields.io/github/v/release/cssxsh/mirai-authenticator)](https://github.com/cssxsh/mirai-authenticator/releases)\n[![Downloads](https://img.shields.io/github/downloads/cssxsh/mirai-authenticator/total)](https://repo1.maven.org/maven2/xyz/cssxsh/mirai/mirai-authenticator/)\n[![maven-central](https://img.shields.io/maven-central/v/xyz.cssxsh.mirai/mirai-authenticator)](https://search.maven.org/artifact/xyz.cssxsh.mirai/mirai-authenticator)\n[![MiraiAuthenticator Test](https://github.com/cssxsh/mirai-authenticator/actions/workflows/test.yml/badge.svg)](https://github.com/cssxsh/mirai-authenticator/actions/workflows/test.yml)\n\n**使用前应该查阅的相关文档或项目**\n\n*   [User Manual](https://github.com/mamoe/mirai/blob/dev/docs/UserManual.md)\n*   [Permission Command](https://github.com/mamoe/mirai/blob/dev/mirai-console/docs/BuiltInCommands.md#permissioncommand)\n*   [Chat Command](https://github.com/project-mirai/chat-command)\n\n**目前只实现了加群验证的功能**\n\n## MCL 指令安装\n\n**请确认 mcl.jar 的版本是 2.1.0+**  \n`./mcl --update-package xyz.cssxsh.mirai:mirai-authenticator --channel maven-stable --type plugin`\n\n## 指令\n\n### auth-join\n\n配置验证条件, 目前 check 中 可选的 type 有 `profile`, `question`, `bilibili`, `afdian`  \n配置验证条件, 目前 validator 中 可选的 type 有 `captcha`\n\n*   `/auth-join check [group] {types}` 进群前检查  \n    例如: `/auth-join check 123456 profile question`\n\n*   `/auth-join validator [group] {types}` 进群后验证  \n    例如: `/auth-join validator 123456 captcha`\n\n*   `/auth-join official [id]` 设置自动放行的QQ号  \n    例如: `/auth-join official 123456789`\n\n*   `/auth-join timeout [mills]` 问题回答等待时间  \n    例如: `/auth-join timeout 180000`\n\n*   `/auth-join count [value]` 问题允许回答次数  \n    例如: `/auth-join count 5`\n\n*   `/auth-join tip [message]` 验证码的提示  \n    例如: `/auth-join tip 请输入图片验证码的内容(不区分大小写)`\n\n*   `/auth-join place [group]` 加群请求失败交由管理员处理  \n    例如: `/auth-join place 123456`\n\n### auth-captcha\n\n测试验证码功能\n\n*   `/auth-captcha` 会发送一张验证码并接受回答，以供测试  \n\n### auth-check\n\n测试进群前检查功能\n\n*   `/auth-check question [group] [question] [answer]` 测试群的 question 验证脚本  \n    `group` 是群号, `question` 是问题, `answer` 是答案  \n    例如: `/auth-check question 123456 天王盖地虎 宝塔镇河妖`  \n\n*   `/auth-check profile [group] [target]` 测试群的 profile 验证脚本  \n    `group` 是群号, `target` 是被测试的qq号  \n    例如: `/auth-check profile 123456 789566`\n\n*   `/auth-check bilibili [group] [uid]` 测试群的 bilibili 验证脚本  \n    `group` 是群号, `uid` 是入群提交的 uid  \n    例如: `/auth-check bilibili 123456 789566`\n\n*   `/auth-check afdian [group] [uid]` 测试群的 afdian 验证脚本  \n    `group` 是群号, `uid` 是入群提交的 uid  \n    例如: `/auth-check afdian 123456 dousha99`\n\n#### 效果\n\n进群后验证:  \n![captcha](example/captcha/screenshot.jpg)\n\n## 配置 Lua 校验脚本\n\n自定义验证分别在以下文件夹中\n*   `data/xyz.cssxsh.mirai.plugin.mirai-authenticator/profile`  \n*   `data/xyz.cssxsh.mirai.plugin.mirai-authenticator/question`\n*   `data/xyz.cssxsh.mirai.plugin.mirai-authenticator/bilibili`\n\n脚本文件名对应群号, 例如 `123456.lua`\n\n`Global variable` (bindings) 支持的属性和方法有以下\n\n*   `bot` bot 对象\n*   `eventId` 事件id\n*   `groupId` 群ID\n*   `groupName` 群名\n*   `message` 请求消息\n*   `invitorId` 邀请人\n*   `fromId` 请求者ID\n*   `fromNick` 请求者NICK\n\n### Profile 校验脚本\n\n`Profile` 校验脚本主要用于校验用户的 `Profile` 信息  \n所以对于 `Profile` 校验脚本, 将支持\n\n*   `fromProfile` 请求者profile\n    *   `getAge` 获取年龄\n    *   `getQLevel` 获取QQ等级\n    *   `getEmail` 获取右键\n    *   `getNickname` 获取昵称\n\n例如，检查申请入群者的QQ等级是否大于4:  \n```lua\nreturn fromProfile:getQLevel() \u003e 4;\n```\n\n### Question 校验脚本\n\n`Question` 校验脚本主要用于校验用户提交的加群问题答案  \n所以对于 `Question` 校验脚本, 将支持\n\n*   `question` 问题\n*   `answer` 回答\n\n例如，检查答案是否满足要求:\n```lua\nreturn answer == \"114514\" or answer == \"......\";\n```\n\n### BiliBili 校验脚本\n\n`BiliBili` 校验脚本主要用于校验用户提交的 `UID` 当前配置的粉丝牌详情  \n对于 `BiliBili` 校验脚本, 将支持\n\n*   `medal` 粉丝牌详情\n    *   `getTargetId` 获取主播UID\n    *   `getScore` 获取积分\n    *   `getLevel` 获取等级\n    *   `getGuardLevel` 获取舰长类型 (0 是非舰长)\n\n例如, 检查是否佩戴了 [哔哩哔哩音悦台#11153765](https://space.bilibili.com/11153765) 的粉丝牌，且为舰长 (等级大等于20) :\n```lua\nreturn medal:getTargetId() == 11153765 and medal:getLevel() \u003e= 20;\n```\n\n### AFDian 校验脚本\n\n`AFDian` 校验脚本主要用于校验用户提交的 `UID` 是否在捐助者列表中  \n对于 `AFDian` 校验脚本, 将支持\n\n*   `query` 查询结果\n    *   `getList` 获取捐助者列表\n        *   `getUser` 获取捐助者信息\n            *   `getUserId` 获取捐助者 ID\n            *   `getName` 获取捐助者 NAME\n        *   `getCurrentPlan` 获取当前捐助计划\n            *   `getName` 获取捐助计划 Name\n            *   `getStatus` 获取捐助状态\n            *   `getPrice` 获取捐助价格\n            *   ...\n        *   `getFirstPayTime` 第一次支付时间\n        *   `getLastPayTime` 最后一次支付时间\n        *   `getAllSumAmount` 总计金额\n    *   `getCount` 获取总数量\n    *   `getPage` 获取当前查询数量\n\n## [爱发电](https://afdian.net/@cssxsh)\n\n![afdian](example/sponsor/afdian.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssxsh%2Fmirai-authenticator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcssxsh%2Fmirai-authenticator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssxsh%2Fmirai-authenticator/lists"}