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-disaster-warning

v0.1.4

Published

Koishi 灾害预警插件,支持多数据源(地震、海啸、气象预警)

Downloads

1,017

Readme

koishi-plugin-disaster-warning

npm

Koishi 灾害预警插件,支持多数据源(地震、海啸、气象预警)实时推送。 本插件移植自 astrbot_plugin_disaster_warning,感谢原作者的开源贡献。

✨ 功能特性

🌍 多数据源支持

插件支持多个可自由选择启用的细粒度数据源,覆盖全球主要地震监测机构:

  • 中国地震网地震预警 (FAN Studio / Wolfx) - 实时地震预警信息。
  • 台湾中央气象署强震即时警报 (FAN Studio / Wolfx) - 台湾地区地震预警。
  • 日本气象厅紧急地震速报 (P2P / Wolfx / FAN Studio) - 日本紧急地震速报。
  • 中国地震台网地震测定 (FAN Studio / Wolfx) - 正式地震测定信息。
  • 日本气象厅地震情报 (P2P / Wolfx) - 详细地震情报。
  • USGS地震测定 (FAN Studio) - 美国地质调查局地震信息。
  • Global Quake服务器 - 全球地震测站实时计算推送,精度有限。
  • 中国气象局气象预警 (FAN Studio) - 气象灾害预警。
  • 自然资源部海啸预警中心 (FAN Studio) - 海啸预警信息。
  • 日本气象厅海啸预报 (P2P) - 日本海啸预报信息。

🎯 智能推送控制

  • 阈值过滤 - 根据震级、烈度、震度设置推送阈值。
  • 频率控制 - 智能推送逻辑,避免短时间内刷屏。
  • 首报推送保证 - 确保预警信息首次下达时总是推送。
  • 震中地区过滤 - 地震类事件会按震中地名与经纬度过滤,关闭全球地区后,CENC 等数据源发布的海外地震不会再误推送。
  • 最终报保证 - 确保最终报总是推送。

🔁 事件去重功能

插件具备基础的事件去重功能,防止同一地震被同一个数据源重复推送。

🤖 ChatLuna 工具调用

可选注册 disaster_warning 工具给 ChatLuna 使用,让模型主动查询近期地震、按地点/震级/时间过滤,或查看数据源连接状态。适合回答“哪里地震了”“某地最近有没有地震”“我关心的人在某地,那里安全吗”等问题。

🚀 安装与使用

安装

npm install koishi-plugin-disaster-warning

或者在 Koishi 插件市场搜索 disaster-warning 安装。

配置

安装完成后,在 Koishi 控制台的「插件配置」页面进行配置:

  1. 启用插件:确保 enabledtrue
  2. 目标群组:在 target_groups 中添加需要推送预警消息的群号。
  3. 灾害类型:在 data_types 中选择是否接收地震预警、地震信息、海啸预警、气象预警。
  4. 接收地区:在 regions 中选择中国大陆、台湾、日本或全球。数据源连接会依据此项自动开启,地震类事件还会按震中位置再次过滤。
  5. 过滤器配置:在 filter 中设置震级、烈度、震度阈值,避免过多打扰。

地区过滤说明

regions 同时控制数据源连接与地震震中地区过滤。例如仅开启中国大陆和台湾、关闭日本与全球时,插件仍可连接 CENC/CWA 等相关数据源,但智利、印尼等不在已开启地区内的地震会被丢弃,不会因为由 CENC 发布就被推送。

当前震中识别优先使用地名关键词,其次使用经纬度范围;无法识别且带有非空地名的地震默认视为全球事件。

ChatLuna 工具设置

如果安装了 koishi-plugin-chatluna,可以在 chatluna 配置项中开启工具注册:

  • chatluna.enabled:开启后注册 ChatLuna 工具,默认关闭。
  • chatluna.name:工具名称,默认 disaster_warning
  • chatluna.default_source:模型未指定来源时查询 allcencjmausgs
  • chatluna.default_days:默认查询最近多少天。
  • chatluna.default_limit:默认最多返回多少条记录。
  • chatluna.min_magnitude:默认最低震级。
  • chatluna.include_usgs_when_all:综合查询时是否包含 USGS 全球地震。

工具输入示例:

{
  "action": "recent_earthquakes",
  "location": "智利",
  "min_magnitude": 5,
  "days": 7,
  "limit": 5
}

也可以使用 { "action": "status" } 查询当前数据源连接状态。

📋 使用命令

插件提供以下指令:

  • disaster - 查看插件帮助信息
  • disaster.test - 发送一条测试预警消息,用于验证配置是否生效
  • disaster.history - 查看最近的地震记录 (数据来源:CENC)

📄 许可证

本项目采用 AGPL-3.0 许可证。