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

v0.3.0

Published

Koishi 自定义图片API插件,内置黑丝/动漫举牌

Readme

koishi-plugin-custom-image

项目介绍 (Project Introduction)

中文

这是一个为 Koishi 机器人框架开发的图片获取与趣味生成插件。支持从自定义 API 列表随机获取图片,内置黑丝举牌 (hsjp) 和动漫举牌 (dmjp) 功能,并提供多种发送模式、多引擎下载、智能缓存、请求去重、发送重试、代理设置与自定义请求头等高级特性。

English

A feature-rich image fetching and fun generation plugin for Koishi. It randomly picks one API from your custom list to fetch images, with built-in hsjp and dmjp generation. Advanced features include multiple sending modes, multi-engine downloads, smart caching, deduplication, retry on failure, proxy support, and custom headers.

项目仓库 (Repository)

  • GitHub: https://github.com/Minecraft-1314/koishi-plugin-custom-image
  • Issues: https://github.com/Minecraft-1314/koishi-plugin-custom-image/issues

核心指令 (Core Commands)

| 指令 (Command) | 说明 (Description) | 示例 (Example) | |----------------|--------------------|----------------| | random-image [apis...] | 从自定义 API 列表随机获取一张图片 | random-imagerandom-image https://api.example.com | | hsjp <msg> [msg1] [msg2] | 生成黑丝举牌图片 | hsjp 我喜欢你 | | dmjp <text> | 生成动漫举牌图片 | dmjp Koishi 真棒 | | clear-image-cache | 清空图片缓存 | clear-image-cache |

配置项说明 (Configuration)

配置已按功能分组显示,方便查找:

基本设置

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | enable | boolean | true | 启用插件 | | showWaitingTip | boolean | true | 请求时显示等待提示 | | hsjpEnabled | boolean | true | 启用黑丝举牌功能 | | dmjpEnabled | boolean | true | 启用动漫举牌功能 | | customImageApis | string[] | [] | 自定义图片 API 列表 | | customImageEnabled | boolean | true | 启用自定义图片功能 |

发送设置

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | imageSendMode | 'image' / 'link' / 'file' | 'image' | 图片发送方式:直接发送图片 / 仅发送链接 / 下载后发送文件 | | showSuccessTip | boolean | true | 请求成功时显示提示 | | showTimeoutTip | boolean | true | API 超时后给用户提示 |

发送与重试

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | ignoreSendError | boolean | true | 忽略发送失败(不抛出异常) | | retryTimes | number | 3 | 发送失败重试次数 | | retryInterval | number | 1000 | 重试间隔(毫秒) |

网络与请求

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | timeout | number | 180000 | API 请求超时 (ms) | | imageSendTimeout | number | 180000 | 消息发送超时 (ms) | | userAgent | string | (Mozilla/5.0 ... Chrome/125.0) | 自定义 User-Agent | | proxyEnabled | boolean | false | 启用代理 | | proxyProtocol | 'http' / 'https' | 'http' | 代理协议 | | proxyHost | string | '127.0.0.1' | 代理地址 | | proxyPort | number | 7890 | 代理端口 | | proxyUsername | string | '' | 代理用户名 | | proxyPassword | string | '' | 代理密码 | | customHeaders | {name, value}[] | [] | 自定义请求头列表 |

下载引擎与性能

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | downloadEngine | 'internal' / 'aria2' / 'downloads' | 'internal' | 下载引擎(仅 file 模式使用) | | downloadConcurrency | number | 3 | 下载线程数 | | downloadTimeout | number | 120000 | 统一下载超时 (ms) | | maxMediaSize | number | 0 | 最大下载文件大小 (MB),0 为不限制 | | aria2Host | string | '127.0.0.1' | aria2 RPC 地址 | | aria2Port | number | 6800 | aria2 RPC 端口 | | aria2Secret | string | '' | aria2 RPC 密钥 | | resumeDownload | boolean | true | 启用断点续传(仅 aria2 模式) |

缓存与临时文件

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | dedupInterval | number | 0 | 去重间隔 (秒),0 表示不去重 | | cacheDuration | number | 0 | 结果缓存时间 (秒),0 表示不缓存 | | autoClearCacheInterval | number | 60 | 自动清理缓存间隔(分钟) | | tempDir | string | ./temp_images | 临时文件目录 |

界面文本

所有提示信息均可自定义,留空则使用内置默认文本。

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | waitingTipText | string | '' | 等待提示 | | successTipText | string | '' | 成功提示 | | timeoutTipText | string | '' | 超时提示 | | networkErrorText | string | '' | 网络错误提示 | | fetchFailedText | string | '' | 获取失败提示 | | inputErrorText | string | '' | 输入为空提示 | | inputTooLongText | string | '' | 输入过长提示 | | cacheClearedText | string | '' | 缓存清理提示 | | repeatRequestText | string | '' | 重复请求提示 |

项目贡献者 (Contributors)

| 贡献者 (Contributor) | 贡献内容 (Contribution) | |----------------------|-------------------------| | Minecraft-1314 | 插件完整开发 (Complete plugin development) | | 素颜API | 提供 API 接口支持 | | (欢迎提交 PR 加入贡献者列表) | (Welcome to submit PR to join the contributor list) |

许可协议 (License)

本项目采用 MIT 许可证,详情参见 LICENSE 文件。

This project is licensed under the MIT License, see the LICENSE file for details.

支持我们 (Support Us)

如果这个项目对您有帮助,欢迎点亮右上角的 Star ⭐ 支持我们,这将是对所有贡献者最大的鼓励!

If this project is helpful to you, please feel free to star it in the upper right corner ⭐ to support us, which will be the greatest encouragement to all contributors!