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-cyberstalking

v0.1.0

Published

A little cyberstalking plugin with native compatibility for multi-bot-controller. I'll keep watching you... always...

Readme

koishi-plugin-cyberstalking

npm

一个用于实时汇报指定用户群聊动态的 Koishi 插件。

插件功能说明

当指定平台下的指定 Bot 在指定群聊中监听到目标用户发言时,插件会将格式化后的提醒消息发送到配置好的群聊或私聊目标。

插件支持:

  • 按平台和 Bot 账号分别配置行为
  • 使用单个 table 配置监听目标群与目标用户
  • 使用 <群ID> 格式在同一行中配置多个目标群
  • 使用 <用户ID> 格式在同一行中配置多个目标用户
  • 目标用户列留空时,默认监听这些群中的所有用户
  • 为每条规则配置正则过滤规则列表
  • 正则过滤规则按顺序匹配,命中任意一条已启用规则即通过
  • 使用模板变量生成提醒消息
  • 在模板中使用 <at id="..."></at> 显式 @ 指定用户
  • 多目标串行发送
  • anti-ban 基础延迟与随机抖动

变量与标签说明

支持的变量:

  • {content}
  • {time}
  • {target_user}
  • {target_user_id}
  • {target_group}
  • {target_group_id}
  • {bot_id}
  • {bot_platform}
  • {bot_self_id}

支持的标签:

<at id="123456789"></at>

该标签会被转换为 Koishi 的 at 消息段,用于在提醒消息中显式 @ 指定用户。

正则过滤规则使用说明

插件中的正则过滤规则会对整条消息文本进行匹配。
配置时只需要填写正则本体不要写两边的 /.../

正确与错误示例

正确写法:

^签到$

错误写法:

/^签到$/

常见示例

1. 精确匹配一句话

^签到$

只匹配内容完全等于 签到 的消息。

2. 匹配以某段文字开头

^使用 ChatLuna 时出现错误,错误码为

可匹配:

  • 使用 ChatLuna 时出现错误,错误码为
  • 使用 ChatLuna 时出现错误,错误码为 114514

3. 匹配包含某个关键词

红包|转账|付款

只要消息里包含这几个词之一就会命中。

4. 匹配任意非空消息

.+

适合联调时测试规则是否能触发。

5. 匹配 slash 命令

^/\S+

可匹配:

  • /help
  • /签到
  • /test 123

特殊字符需要转义

如果你想按“原样文本”匹配,以下字符通常需要转义:

  • (\(
  • )\)
  • [\[
  • ]\]
  • .\.
  • ?\?
  • +\+
  • *\*

例如你想匹配:

刚才没注意,能再说一遍吗(。-ω-)

正确写法应为:

^刚才没注意,能再说一遍吗\(。-ω-\)$

因为在正则里,() 默认表示分组,不代表字面量括号。


多条正则规则的匹配逻辑

regexFilters 是一个 table,插件会:

  1. 按顺序检查每条已启用的规则
  2. 某一条匹配成功就立即通过
  3. 如果全部不匹配,则该监控规则被跳过

也就是说,多条正则是“命中任意一条即通过”,不是必须全部匹配。


调试建议

如果你不确定是规则写错还是插件逻辑有问题,可以先临时把正则写成:

.+

如果这样能触发,说明:

  • Bot 匹配正常
  • 群 / 用户匹配正常
  • 发送流程大概率正常
  • 问题就在你原来的正则写法

License

MIT