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-burn-after-reading

v1.0.3

Published

阅后即焚,群管插件,开启状态下会定时撤回用户发送的所有消息以保护隐私

Readme

koishi-plugin-burn-after-reading

npm

阅后即焚群管插件,开启状态下会定时撤回用户发送的所有消息以保护隐私。

功能特性

  • 个人控制:每个用户可以独立控制自己的阅后即焚模式
  • 🔒 隐私保护:关闭阅后即焚时批量撤回所有消息,保护敏感信息
  • ⏱️ 可配置延迟:支持自定义批量撤回前的延迟时间和消息间隔
  • 👥 多用户支持:支持同一群组内多个用户同时开启
  • 🔄 自动过期:超过最大持续时长后自动关闭并触发批量撤回
  • 💾 持久化存储:使用数据库存储消息记录
  • 🛡️ 权限检查:自动检查 bot 是否具有撤回消息的权限

使用方法

开启阅后即焚

使用以下任一命令开启阅后即焚模式:

阅后即焚.开启

或使用别名:

开启阅后即焚

开启后,你发送的每条消息都会被记录,当你关闭阅后即焚模式时,这些消息将被批量撤回。

关闭阅后即焚

使用以下任一命令关闭阅后即焚模式:

阅后即焚.关闭

或使用别名:

关闭阅后即焚

配置项

在 Koishi 配置面板中,你可以调整以下参数:

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | recallDelay | number | 120 | 关闭阅后即焚后,延迟多少秒开始批量撤回(秒) | | maxDuration | number | 3600 | 单次开启阅后即焚的最大持续时长(秒) | | maxUsers | number | 10 | 同时开启阅后即焚的最大用户数 | | batchRecallInterval | number | 1 | 批量撤回时每条消息之间的间隔(秒) |

配置说明

  • recallDelay:关闭阅后即焚模式后,延迟多少秒开始批量撤回消息。建议设置为 120 秒(2 分钟),给用户一个缓冲时间。
  • maxDuration:用户开启阅后即焚模式后,最多持续多长时间自动关闭。默认 3600 秒(1 小时)。
  • maxUsers:为了防止滥用,限制同一群组内同时开启阅后即焚的用户数量。
  • batchRecallInterval:批量撤回消息时,每条消息之间的时间间隔,用于避免频繁调用平台 API 导致限流。默认 1 秒。

注意事项

  1. Bot 权限:Bot 必须具有群管理员权限才能撤回消息,且用户管理级别必须小于 bot(比如 bot 是管理员,用户是管理员或群主则无法开启)
  2. 平台限制:不同平台对消息撤回有时间限制(如 QQ 平台为 2 分钟),请确保 recallDelay + 消息发送时间不超过平台限制
  3. 仅限群聊:此插件仅在群聊中生效,私聊无法使用
  4. 数据库依赖:需要配置 Koishi 数据库(database)服务才能正常使用
  5. 批量撤回:消息不会立即撤回,而是在关闭阅后即焚时统一撤回

工作原理

  1. 用户开启阅后即焚模式后,插件会在数据库中记录该用户的状态
  2. 当用户发送消息时,插件会监听消息事件并将消息信息存储到数据库
  3. 当用户关闭阅后即焚模式时,插件会:
    • 等待 recallDelay
    • 从数据库查询该用户在开启期间发送的所有消息
    • 按顺序撤回每条消息,每条消息之间间隔 batchRecallInterval
    • 撤回完成后从数据库删除相应记录
  4. 如果用户开启阅后即焚超过最大持续时长,插件会自动关闭该用户的阅后即焚模式并触发批量撤回
  5. Bot 重启后,插件会恢复用户的阅后即焚状态和自动过期定时器

数据库表结构

插件会自动创建以下两个数据库表:

burn_after_reading_users

存储开启阅后即焚模式的用户信息:

  • id: 自增主键
  • userId: 用户 ID
  • guildId: 群组 ID
  • channelId: 频道 ID
  • enabledAt: 开启时间
  • expiresAt: 过期时间

burn_after_reading_messages

存储待撤回的消息信息:

  • id: 自增主键
  • messageId: 消息 ID
  • userId: 用户 ID
  • guildId: 群组 ID
  • channelId: 频道 ID
  • sentAt: 发送时间

许可证

MIT License