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-image-saver

v1.1.20

Published

群内存图/更图插件:仅引用存图,支持群共享/群内个人及管理员动态切换

Readme

koishi-plugin-image-saver

群内存图 / 更图插件:仅支持引用存图,支持群共享、群内个人,以及管理员动态切换群模式。

功能介绍

  • 存图:仅支持“引用含图消息 + 感叹号指令”进行保存
  • 更图:使用感叹号指令发出当前作用域已保存的图片
  • 支持两种绑定模式:群共享(同群一张图)/ 群内个人(同群每人一张图)
  • 支持按群覆盖模式:可以指定某些群共享、某些群个人
  • 支持管理员命令动态切换当前群模式,且重启后仍保留
  • 每个作用域只保存一张图片,再次存图会覆盖旧图
  • 命令主体可自定义,插件会自动兼容英文感叹号 ! 与中文感叹号
  • 不带感叹号前缀不会触发命令

安装

在 Koishi 控制台插件市场搜索 image-saver 安装,或在 koishi.yml 中手动添加:

plugins:
  image-saver:
    saveCommand: "!存图"
    getCommand: "!更图"
    modeCommand: "!存图模式"
    bindMode: guild
    modeAdminUserIds:
      - "123456789"
    guildModeOverrides:
      - guildId: "123456789"
        mode: user
      - guildId: "987654321"
        mode: guild

配置项

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | saveCommand | string | 存图 | 存图命令主体,配置写 存图!存图 都可以 | | getCommand | string | 更图 | 更图命令主体,配置写 更图!更图 都可以 | | modeCommand | string | 存图模式 | 模式切换命令主体,配置写 存图模式!存图模式 都可以 | | bindMode | guild \| user | guild | guild=群共享;user=群内按用户隔离 | | modeAdminUserIds | string[] | [] | 可执行 modeCommand 的管理员 QQ 号(userId)白名单 | | guildModeOverrides | array | [] | 按群覆盖模式,未匹配到的群走 bindMode |

感叹号兼容说明

  • 如果您在配置里写的是 !存图,实际会同时支持:
    • !存图
    • !存图
  • 如果您在配置里写的是 !更图,实际会同时支持:
    • !更图
    • !更图
  • 存图模式 也是同样规则
  • 插件内部会自动忽略配置里是否手动带了 ! / ,统一做中英文感叹号兼容

使用示例

用户:[引用一条图片消息并发送:!存图]
机器人:✅ 存图成功!

用户:[引用一条图片消息并发送:!存图]
机器人:✅ 存图成功!

用户:!更图
机器人:[发出之前存的图片]

管理员切换群模式

管理员:!存图模式
机器人:当前模式:群共享模式
       用法:!存图模式 共享 或 !存图模式 个人

管理员:!存图模式 个人
机器人:✅ 已切换为群内个人模式

普通成员:!存图模式 共享
(无反馈)

注意事项

  • 此指令仅限群聊使用,私聊中无效
  • 存图只支持引用图片,不支持“先发存图再补图”
  • 不带感叹号前缀(如仅发“存图/更图”)不会触发指令
  • 图片以二进制文件形式保存在 Koishi 数据目录下的 data/image-saver/ 文件夹中,不依赖图片 URL(QQ 图片 URL 有时效限制)
  • 支持格式:PNG、JPG、GIF、WebP
  • bindMode=user,同一群内 A、B 使用同一条“更图”命令时,只会拿到各自存入的图片
  • 若配置了 guildModeOverrides,其优先级高于 bindMode
  • 管理员指令切换结果会持久化到 data/image-saver/guild-mode-overrides.json,且优先级高于 guildModeOverrides
  • modeAdminUserIds 之外的用户调用模式切换指令时,插件不返回任何消息

数据存储路径

<Koishi 数据目录>/data/image-saver/<作用域键>.<ext>

License

MIT