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-xiaohua-monetary

v0.0.2

Published

Monetary System for xiaohua bot

Readme

koishi-plugin-xiaohua-monetary

npm

小划 bot 自用货币系统插件。

本插件基于 koishi-plugin-nailong-monetary(作者:ziyi233)修改而来,感谢原作者的开源贡献。

主要改进

  • 统一 userId 生成规则:所有用户 ID 统一使用不带平台前缀的格式存储
  • 管理员余额修改:新增 monetary.set 指令,允许管理员修改用户余额
  • 数据导入导出:支持将货币数据导出为 JSON 文件,便于数据迁移和备份

指令列表

用户指令

| 指令 | 别名 | 说明 | |------|------|------| | monetary.balance [target] | 余额 | 查询点数余额(管理员可查询他人) | | monetary.transfer [target] [amount] | 转账 | 转账点数给其他用户 |

管理员指令(需要 4 级权限)

| 指令 | 别名 | 说明 | |------|------|------| | monetary.set <target> <amount> | 设置余额 | 修改用户余额 | | monetary.fix-uid | 修复uid | 批量补充缺失的 uid | | monetary.export | 导出数据 | 导出货币数据到 JSON 文件 | | monetary.import | 导入数据 | 从 JSON 文件导入货币数据 |

指令详解

monetary.set 修改余额

monetary.set @用户 <金额>

金额格式:

  • 100:增加 100
  • -50:减少 50
  • =1000:设置为 1000

选项:

  • -c <currency>:指定货币类型(默认 default

monetary.export 导出数据

monetary.export [-c <currency>]

将货币数据导出到配置的目录,生成带时间戳的 JSON 文件。

monetary.import 导入数据

monetary.import [-o|-m]

从配置的 JSON 文件导入数据。

选项:

  • -o:强制覆盖模式(直接设置为导入值)
  • -m:强制合并模式(累加到现有值)

配置项

基础设置

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | msgCostSuccess | string | 💰 已扣除 {cost} {currency},当前余额:{balance} | 扣费成功消息 | | msgInsufficientBalance | string | ❌ 余额不足!需要 {cost} {currency},当前余额:{balance} | 余额不足消息 | | showBalance | boolean | true | 扣费后是否显示余额 |

数据迁移

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | exportDir | string | ./data/monetary-backup | 数据导出目录 | | importFile | string | ./data/monetary-backup/import.json | 导入文件路径 | | importMode | overwrite | merge | merge | 导入模式 |

导出文件格式

[
  { "userId": "123456789", "currency": "default", "value": 1000 },
  { "userId": "987654321", "currency": "default", "value": 500 }
]

导出文件只包含 userIdcurrencyvalue,不包含 uid(跨实例迁移时 uid 不通用)。导入后可使用 修复uid 指令补充。

依赖服务

  • 必需database
  • 可选profile(用于在用户资料中显示余额)

许可证

MIT