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-yutang-starluck-plus

v0.1.0

Published

整合今日人品,今日运势(抄袭shangxue的),签到,bili塔罗牌等功能的集合插件,适配新版QQ官方器人

Readme

koishi-plugin-yutang-starluck-plus

npm

整合今日人品,今日运势(参考 shangxue 的 jrys-prpr),签到等功能的集合插件,适配新版 QQ 官方机器人 markdown 发送。

功能

  • 🌟 今日运势:基于种子算法,同一用户同一天结果固定
  • 🖼️ 双出图方案
    • 卡片模式:puppeteer 渲染精美运势卡片(头像 + 背景图 + 运势文字)
    • 图文模式:二次元 API 配图 + markdown 运势文字
  • 🔘 三按钮交互:重抽 / 切换模式 / 分享(QQ 官方 bot markdown 按钮)
  • 📅 签到机制:每用户每频道每天记录一次签到
  • 💰 货币奖励(可选):每日首次查看运势时发放货币
  • 🔄 重抽(可选):消耗货币重新抽取运势
  • 📤 分享:获取纯文本版运势,方便转发

两种出图模式

卡片模式(puppeteer 渲染)

参考 jrys-prpr 的设计,用 HTML 模板渲染运势卡片:

  • 用户头像(QQ 官方 bot 自动获取)
  • 背景图(可配置默认图,或用二次元 API 随机图)
  • 运势等级、幸运星、签语、详解
  • 磨砂玻璃蒙版 + 渐变彩色幸运星

图文模式(API 配图)

参考 yutang-ills-plus 的实现,调用羽棠小屋二次元图集 API:

  • 随机一张横图/竖图作为配图
  • markdown 文字排版(运势等级 + 签语 + 详解)
  • 图片尺寸可配置

依赖

| 服务 | 必需 | 说明 | | --- | --- | --- | | mdsend | 否(推荐) | 安装 koishi-plugin-smmcat-mdsend 后自动使用,发送原生 markdown | | database | 否 | 用于记录签到状态、重抽次数、用户偏好模式 | | monetary | 否 | 用于签到发奖、重抽扣费 | | puppeteer | 否(卡片模式必需) | 卡片模式渲染 HTML 截图 | | http | 否(图文模式必需) | 调用二次元图片 API |

命令

| 命令 | 别名 | 说明 | | --- | --- | --- | | 今日运势 | jrys | 查看今日运势(每日固定) | | 今日运势.重抽 | jrys.重抽 / 换一张 / 再来一张 | 消耗货币重新抽取(需 enableReroll) | | 今日运势.切换模式 | 今日运势.模式 / jrys.切换模式 | 切换卡片/图文模式 | | 今日运势.分享 | jrys.分享 | 获取纯文本版运势(方便转发) |

三按钮说明

每条运势消息下方自带三个按钮(QQ 官方 bot 专属):

| 按钮 | 功能 | | --- | --- | | 🔄 重抽 | 重新抽取今日运势(消耗货币,每日上限) | | 🎨 切换模式 | 在「卡片模式」和「图文模式」之间切换,偏好自动保存 | | 📤 分享 | 发送纯文本版运势,方便复制转发 |

配置项

基础配置

| 字段 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | command | string | 今日运势 | 主命令名 | | debugLog | boolean | false | 调试日志 | | defaultMode | 'card' \| 'image-text' | image-text | 默认输出模式 | | enableSignIn | boolean | true | 启用签到记录 | | enableCurrency | boolean | false | 启用签到货币奖励 | | currencyAmount | number | 10 | 每日首次签到发放的货币数量 | | enableReroll | boolean | false | 启用重抽子命令 | | rerollCost | number | 20 | 每次重抽消耗的货币数量 | | rerollLimit | number | 3 | 每日重抽次数上限(0 = 无限) | | fortuneProbabilityTable | table | 见下 | 运势概率权重表 | | showUsername | boolean | true | 群聊中 @ 触发用户 | | showDate | boolean | true | 显示日期 | | disclaimer | string | 仅供娱乐 \| 相信科学 \| 请勿迷信 | 底部免责声明 |

按钮配置

| 字段 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | button.enable | boolean | true | 显示 markdown 三按钮 | | button.rerollLabel | string | 🔄 重抽 | 重抽按钮文字 | | button.switchLabel | string | 🎨 切换模式 | 切换模式按钮文字 | | button.shareLabel | string | 📤 分享 | 分享按钮文字 |

图文模式配置

| 字段 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | imageApi.enable | boolean | true | 启用二次元图集 API | | imageApi.apiUrl | string | https://www.yutangxiaowu.cn:3011/api/image/random | API 地址 | | imageApi.apikey | string | '' | 羽棠小屋 apikey(加群 738988912 获取) | | imageApi.defaultOrientation | 'h' \| 'v' | h | 默认图片方向(横图/竖图) | | imageApi.imgWidth | number | 400 | markdown 图片显示宽度 (px),0 = 自动 | | imageApi.imgHeight | number | 0 | markdown 图片显示高度 (px),0 = 按比例 |

卡片模式配置

| 字段 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | card.enable | boolean | true | 启用卡片模式 | | card.screenshotQuality | number | 85 | 截图质量 (%) | | card.viewportWidth | number | 1080 | 视口宽度 (px) | | card.viewportHeight | number | 1920 | 视口高度 (px) | | card.maskColor | string | rgba(0,0,0,0.45) | 蒙版颜色 | | card.maskBlur | number | 20 | 蒙版模糊半径 (px) | | card.userNameColor | string | #ffffff | 用户名颜色 | | card.horoscopeTextColor | string | #ffffff | 运势标题颜色 | | card.horoscopeDescColor | string | #f0f0f0 | 运势详解颜色 | | card.dashedBoxThickness | number | 2 | 虚线框粗细 (px) | | card.dashedBoxColor | string | rgba(255,255,255,0.5) | 虚线框颜色 | | card.luckyStarGradient | boolean | true | 幸运星渐变彩色 | | card.backgroundImage | string | '' | 默认背景图 URL(留空则用 API 图) | | card.avatarStyle | 'round' \| 'square' \| 'none' | round | 头像样式 | | card.font.family | string | system-ui, -apple-system, sans-serif | 字体族 | | card.font.dataUrl | string | '' | 字体 base64 data URL(可选) |

默认运势概率表

| 运势 | luckValue | 概率 | | --- | --- | --- | | ☆☆☆☆☆☆☆ | 0 | 5 | | ★☆☆☆☆☆☆ | 14 | 10 | | ★★☆☆☆☆☆ | 28 | 12 | | ★★★☆☆☆☆ | 42 | 15 | | ★★★★☆☆☆ | 56 | 30 | | ★★★★★☆☆ | 70 | 35 | | ★★★★★★☆ | 84 | 45 | | ★★★★★★★ | 98 | 25 |

Markdown 输出示例(图文模式)

# 🌟 今日运势

📅 2026/07/07

<qqbot-at-user id="..." />

![img #400px](https://example.com/image.jpg)

## 🎴 运势等级

**大吉**  ★★★★★★☆

## ✨ 签语

> 草木逢春,枯叶沾露,稳健着实,必得人望

## 📖 详解

> 挽回家运矣春光,顺调发展财辉煌,温和笃实阴阳合,稳健顺调得人望。
> 顺风满帆而容易有所成就,易取富贵人生。

> ✅ 今日签到成功,获得 10 货币

---

💡 仅供娱乐 | 相信科学 | 请勿迷信

数据库表

yt_jrys_signin — 签到与偏好表

| 字段 | 类型 | 说明 | | --- | --- | --- | | id | unsigned | 主键,自增 | | userId | string | 用户 ID | | channelId | string | 频道 ID | | lastSignIn | string | 最后签到日期 (YYYY/MM/DD) | | rerollCount | unsigned | 今日重抽次数 | | preferMode | string | 用户偏好模式(card / image-text) | | imageOrientation | string | 图片方向偏好(h / v) |

致谢