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-node-cdut

v0.0.2

Published

将成都理工大学服务接入Koishi

Readme

koishi-plugin-node-cdut

npm

将成都理工大学服务接入 Koishi —— 对接 NodeCDUT 接口服务。

功能

  • 指令前缀: 支持配置多个前缀(如 !、/),也可开启「被 @机器人 视为前缀」;启用前缀后仅 前缀+关键词(或 @机器人 关键词)可触发,裸关键词消息静默忽略
  • CDUT菜单 (默认关键词 CDUT菜单): 展示全部可用指令及用法,菜单指令始终置顶,新增指令自动出现在菜单中
  • 查电费 (默认关键词 查电费):
    • 查电费 —— 使用插件设置中的默认房间
    • 查电费 银杏园 1栋 512 空调 —— 园区 / N栋 / 房间号 / 照明|空调,缺省项回退到默认房间
    • 指定了房间信息但未指定照明/空调时,两者都查询(逐行回复)
  • 充电费 (默认关键词 充电费): 必须指定用电类型和金额,房间可选
    • 充电费 空调 50元、充电费 银杏园 1栋 512 照明 0.01
    • 创建真实待支付订单(自动关闭同项目未完成订单),回复含支付链接
  • 定时任务 (cron): 按 cron 表达式(5 字段:分 时 日 月 周,支持 *、,、-、/)定时执行任意已注册指令(按关键词引用,含未来新增指令),可携带自定义指令参数;推送到多个目标(平台:群号 为群消息、平台:private:用户ID 为私聊,逐 job 配置),目标间发送延时可配置数值与单位(秒/分钟/小时),目标留空的任务不生效
    • 发送条件: 可设置如 remain < 20 的条件表达式,变量与消息模板通用(随指令而异),多个条件用 与/或/非(或 &&/||/!)连接并支持括号,中文值可直接书写(如 type == 照明);查询多个用电类型时任一类型满足即发送;留空总是发送;条件不满足时跳过发送但仍输出执行结果日志
    • 消息模板: 每个任务可覆盖该指令的默认消息模板;定时任务的推送与执行结果日志均受「发出日志」开关控制
  • 收发日志: 匹配指令时输出平台、群号(私聊标注)、用户 ID 与消息原文(缓存/限流/名单拦截附注),回复时输出回复内容;两类日志各有独立开关
  • 黑白名单: 群名单与用户名单分开设置,均可独立切换黑名单(名单内不响应)/ 白名单(仅名单内响应)模式;群内发送者同样匹配用户名单,私聊不受群名单限制;仅影响本插件的指令响应,不干涉其他插件
  • 凭据托管:首次调用自动登录,会话凭据持久化到插件目录下的 session.json;后续请求自动携带,响应带回新凭据时自动替换;凭据过期时自动重新登录并重试。凭据与账号绑定,修改账号后旧凭据自动作废。
  • 控制台 NodeCDUT 页面:测试登录、测试房间查询 (可临时覆盖房间字段,用电类型可选「照明和空调」);展示每个定时任务的指令、目标与未来 N 次触发时间(N 由配置指定)。

配置

| 字段 | 说明 | |---|---| | baseUrl | NodeCDUT 服务地址,默认 http://localhost:3000 | | username / password | 统一身份认证账号 (学号) 与密码 | | room | 默认房间:园区 / 用电类型 (含「照明和空调」) / 栋号 / 房间号 | | prefix.list | 指令前缀列表,每项为任意字符串(如 !、/);为空且未开启 @ 识别(默认)时不启用前缀功能,关键词按 Koishi 默认方式解析 | | prefix.at | 被 @机器人 也视为指令前缀(如 @机器人 查电费),默认关闭 | | keyword / chargeKeyword / menuKeyword | 查询 / 充值 / 菜单触发关键词,默认 查电费 / 充电费 / CDUT菜单 | | replyTemplate | 查询成功模板,变量: {park} {type} {building} {room} {remain} {total} {canbuy} {project} | | chargeTemplate | 充值下单模板,变量: {amount} {park} {type} {building} {room} {orderNo} {orderId} {payLink} {closeTime} | | errorTemplate | 失败模板,变量: {error} | | cache | 指令缓存(时长数值 + 单位:秒/分钟/小时,默认 15 分钟,0 关闭):相同指令在缓存期内直接回复缓存结果,不触发接口请求 | | rateLimit | 消息限流(时长数值 + 单位,默认 0 即关闭):一个时间窗口内插件只响应一条指令 | | logging.received / logging.sent | 日志开关:匹配指令时记录群号、用户 ID、消息原文(默认开);回复时记录回复内容(默认开) | | cron.jobs | 定时任务列表,每项含:command(指令关键词,留空为查电费)、arguments(指令参数文本)、expression(cron 表达式)、targets(目标列表:平台:群号 或 平台:private:用户ID,留空不生效)、delay(多目标发送延时,数值 + 单位)、conditions(发送条件表达式,如 remain < 20,留空总是发送)、template(消息模板,留空用指令默认模板) | | cron.preview | 控制台页面中每个任务显示的未来触发次数,默认 5 | | filter.groupMode / filter.groups | 群名单模式(黑/白名单)与群号列表;仅作用于群消息 | | filter.userMode / filter.users | 用户名单模式(黑/白名单)与用户 ID 列表;群消息与私聊均生效 |