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-platform-clock

v1.0.5

Published

车队平台打卡统计

Readme

koishi-plugin-platform-clock

npm

车队平台打卡统计插件。插件调用车队平台接口,按活动开始日期统计成员打卡次数,生成前 10 名打卡排行榜图片,并支持定时推送。

功能特性

  • 按日期范围统计打卡次数并生成排行榜
  • 仅展示前 10 名
  • 排行榜以精美 PNG 图片发送
  • 根据用户 ID 匹配并展示车队编号
  • 每周日 22:00 推送本周打卡排行
  • 每月最后一天 22:00 推送本月打卡排行
  • 仅允许 OneBot 适配器使用指令
  • 支持限制指令可用群聊和定时推送群聊

前置依赖

  • koishi-plugin-puppeteer:用于将排行榜 HTML 渲染为图片
  • OneBot 适配器:用于执行查询指令和发送定时排行

配置项

| 配置项 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | platformUrl | string | 是 | 车队平台地址,例如 https://example.com | | token | string | 是 | 车队平台 API Token | | allowedGroups | string[] | 否 | 允许使用查询指令的群聊 ID 列表。为空时没有群聊可使用该指令 | | sendGroups | string[] | 否 | 定时推送排行榜的群聊 ID 列表 |

token 仅用于请求用户信息接口;打卡记录接口按照当前平台接口格式请求:

{platformUrl}/api/activity/clock/list?page=1&limit=100

用户信息接口用于根据打卡记录中的 userId 匹配 teamId:

{platformUrl}/api/user/info/list?page=1&limit=100&tmpId=&tmpName=&teamId=&qq=&state=0&teamRole=&token={token}

两个接口都会根据返回的 totalPage 自动请求全部分页数据。

指令

打卡排行

别名:clock-rank

查询指定日期范围内的打卡排行榜。日期筛选使用打卡记录的 activityStartTime 字段,统计同一 userId 在范围内的记录数量。

格式:

打卡排行 <开始日期> <结束日期>

示例:

打卡排行 2026-07-01 2026-07-22
clock-rank 2026-07-01 2026-07-22

使用限制:

  • 仅限 OneBot 适配器
  • 仅限 allowedGroups 中配置的群聊使用
  • 日期格式必须为 YYYY-MM-DD
  • 开始日期不能晚于结束日期

定时推送

| 任务 | 时间 | 统计范围 | | --- | --- | --- | | 周排行 | 每周日 22:00 | 本周周一至周日 | | 月排行 | 每月最后一天 22:00 | 当月 1 日至月末 |

推送目标为 sendGroups 中配置的群聊。插件只会向 OneBot 机器人发送消息。

排行榜图片

排行榜图片包含:

  • 排名、成员名称和打卡次数
  • 前三名金银铜特殊徽章
  • 匹配成功时显示车队编号
  • 统计日期范围和参与人数