npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

koishi-plugin-yyds-verifier

v0.0.5

Published

入群验证插件,支持数字验证码、算数验证、图像验证码等多种验证方式

Readme

koishi-plugin-yyds-verifier

npm

入群验证插件,支持多种验证方式,有效防止机器人和恶意用户入群。

功能特性

  • 多种验证方式

    • 数字验证码:用户需要输入显示的数字
    • 算数验证:用户需要计算简单的加法或乘法(如 3+5=? 或 4×7=?)
    • 图像验证码:用户需要识别图片中的字符
    • 随机模式:随机选择以上三种方式之一
  • 白名单功能:指定用户入群时无需验证

  • 可配置参数

    • 验证超时时间
    • 最大尝试次数
    • 验证码长度
    • 自定义消息模板
  • 安全特性

    • 验证失败自动踢出
    • 可选永久踢出(加入群黑名单)

安装

前置依赖

本插件需要 koishi-plugin-skia-canvas 作为依赖,请先安装:

npm install koishi-plugin-skia-canvas

安装插件

npm install koishi-plugin-yyds-verifier

配置项

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | mode | string | 'code' | 验证方式:code=数字验证码, math=算数验证, image=图像验证码, random=随机 | | timeout | number | 300 | 验证超时时间(秒) | | maxAttempts | number | 3 | 最大尝试次数 | | permanent | boolean | false | 是否永久踢出(加入群黑名单) | | codeLength | number | 4 | 验证码长度(仅对 code 和 image 模式有效) | | whitelist | string[] | [] | 白名单用户 ID 列表 | | messages | object | - | 自定义消息模板 |

消息模板

| 配置项 | 默认值 | 可用变量 | |--------|--------|----------| | messages.prompt | '欢迎加入!请在 {timeout} 内完成验证。{question} 当前第 {attempt}/{maxAttempts} 次机会。' | {timeout} {question} {attempt} {maxAttempts} | | messages.success | '验证成功!欢迎加入本群。' | - | | messages.failure | '验证失败,请重新输入。剩余 {remaining} 次机会。' | {remaining} | | messages.timeout | '验证超时,进入下一轮验证。剩余 {remaining} 次机会。' | {remaining} | | messages.kicked | '验证失败次数过多,已被移出群聊。' | - |

使用示例

基础配置

plugins:
  yyds-verifier:
    mode: code
    timeout: 300
    maxAttempts: 3

使用算数验证

plugins:
  yyds-verifier:
    mode: math
    timeout: 120
    maxAttempts: 3

使用图像验证码

plugins:
  yyds-verifier:
    mode: image
    timeout: 180
    codeLength: 4

配置白名单

plugins:
  yyds-verifier:
    mode: random
    whitelist:
      - '123456789'
      - '987654321'

验证流程

用户入群
    ↓
检查白名单 → 在白名单中 → 跳过验证
    ↓ 不在白名单
生成验证挑战
    ↓
发送验证提示
    ↓
等待用户输入 → 超时 → 还有机会? → 是 → 下一轮
    ↓                              ↓ 否
验证答案                          踢出用户
    ↓
正确 → 验证成功
    ↓ 错误
还有机会? → 是 → 提示错误,继续等待
    ↓ 否
踢出用户

注意事项

  1. 机器人需要有踢人权限才能正常工作
  2. 建议将验证超时时间设置在 60-300 秒之间
  3. 图像验证码模式需要 koishi-plugin-skia-canvas 支持
  4. 白名单中的用户 ID 需要是字符串格式

许可证

MIT