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-multi-qa

v1.0.8

Published

Koishi多问答插件 - 支持关键词/正则匹配,可回复文本、图片和文件,提供美观的配置界面

Readme

Koishi 多问答插件 (multi-qa)

支持关键词/正则匹配,可回复文本、图片和文件,支持文件上传存储。

GitHub仓库地址: https://github.com/aynuzbh/koishi-plugin-multi-qa

功能特性

  • 支持关键词匹配和正则表达式匹配
  • 支持回复文本、图片和文件
  • 支持文件上传和本地存储
  • 提供可视化配置界面

安装

npm install koishi-plugin-multi-qa
# 或
yarn add koishi-plugin-multi-qa

配置说明

规则配置

每个规则支持以下字段:

  • pattern: 匹配模式(字符串或正则表达式)
  • isRegex: 是否使用正则匹配(默认false)
  • replyType: 回复类型(text/image/file)
  • content: 回复内容或资源路径
  • enabled: 是否启用该规则(默认true)

在Koishi配置文件中添加:

export default {
  plugins: {
    'multi-qa': {
      file: {
        uploadPath: 'data/multi-qa', // 本地文件存储路径
        useDirectLink: false,        // 是否使用直链
        directLinkPrefix: '',        // 直链URL前缀
      },
      rules: [
        {
          pattern: '你好',
          isRegex: false,
          replyType: 'text',
          content: '你好呀!'
        },
        {
          pattern: '^\\d+$',
          isRegex: true,
          replyType: 'text',
          content: '你发送了一个纯数字消息'
        },
        {
          pattern: '图片',
          isRegex: false,
          replyType: 'image',
          content: 'https://example.com/image.png'
        }
      ]
    }
  }
}

使用说明

  1. 关键词回复:配置规则后,当用户发送匹配的消息时,机器人会自动回复
  2. 文件上传:用户发送"上传文件"并附带文件,文件将保存到指定目录
  3. 文件回复:配置file类型的回复规则,content可以是本地路径或URL

注意事项

  • 文件存储路径默认是data/multi-qa
  • 确保服务器有写入权限
  • 正则表达式需要双重转义(如\\d+
  • 完全支持中文文件名上传和下载
  • 文件名中的特殊字符会自动替换为下划线