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-multibot-groupwelcome

v1.0.3

Published

Multi-bot group welcome/leave messages - manage per-group welcome and leave messages for multiple bots sharing one Koishi instance, with no extra plugins required

Readme

koishi-plugin-multibot-groupwelcome

群组欢迎/退群消息插件 - 多个 Bot 共用同一 Koishi 实例,为每个 Bot 独立管理群组欢迎和退群消息,无需其他插件支持。

功能特性

  • 🤖 多 Bot 支持:多个 Bot 登录在同一 Koishi 实例中,按「平台 + Bot ID」独立配置各自的欢迎/退群消息
  • ⏱️ 延迟合并发送:短时间内的多条入群/退群事件可合并为一条消息,避免刷屏
  • 💬 丰富的消息变量:支持用户昵称、头像、群信息、时间、一言等多种变量
  • 📊 Table 表格配置:可视化配置界面,按群组管理消息
  • 🔌 零外部依赖:不依赖 multi-bot-controller 等任何控制器插件,直接填写平台与 Bot ID 即可

安装

npm install koishi-plugin-multibot-groupwelcome

配置示例

在插件配置界面中:

  1. 添加 Bot 并填写(均可在控制台 - 机器人列表中查看):
    • 平台名称:如 onebot / discord / telegram
    • Bot 自身账号 ID:即 selfId,机器人列表中显示的账号号
  2. 选择延迟模式:
    • 滑动窗口:每个新事件重置定时器,最大化合并效果(默认)
    • 固定窗口:第一个事件触发后不再重置,延迟时间可预测
  3. 为每个 Bot 配置入群欢迎消息和退群消息:

入群欢迎消息配置

| 群组/频道 ID | 入群欢迎消息 | 延迟发送时间(秒) | |-------------|-------------|------------------| | 123456789 | 欢迎 {user} 加入群组!当前人数 {group_count} | 5 | | 987654321 | 欢迎 {user}、{avatar} | 0 |

退群提醒消息配置

| 群组/频道 ID | 退群提醒消息 | 延迟发送时间(秒) | |-------------|-------------|------------------| | 123456789 | {user} 离开了群组 | 3 |

消息变量

| 变量 | 说明 | 示例 | |------|------|------| | {user} | 用户昵称(退群消息中若同时存在{id}则此项被忽略) | 张三 | | {id} | 用户 ID | 123456789 | | {at} | @该用户 | @123456789 | | {avatar} | 用户头像 | avatar | | {group} | 群组名称 | 测试群 | | {group_id} | 群组 ID | 123456789 | | {group_count} | 群组人数(依赖平台成员列表 API,qq 官方机器人平台的群聊不支持,将显示为空) | 100 | | {time} | 当前时间 | 2026/02/14 20:00:00 | | {hitokoto} | 一言 | 这一生,我仅为我自己而活。 | | {br} | 换行 | | | {imageURL="..."} | 插入图片,支持本地路径、file:// URL、http(s) URL(本地资源需在配置中启用) | |

注意:由于 OneBot 协议限制,退群事件不包含用户昵称信息。因此退群消息建议使用 {id} 而非 {user}。若消息中同时包含 {user} 和 {id},插件会自动忽略 {user} 变量。

延迟合并发送

设置 延迟发送时间 大于 0 时,会启用延迟合并功能:

  • 0 秒:立即发送消息(默认)
  • 大于 0:等待指定秒数后,将该时间段内的多条入群/退群事件合并为一条消息发送

延迟模式

每个 Bot 可以选择不同的延迟模式:

| 模式 | 行为 | 适用场景 | |------|------|----------| | 滑动窗口 | 每个新事件重置定时器 | 希望最大化合并效果,允许延迟较长 | | 固定窗口 | 第一个事件触发后不再重置 | 希望延迟时间可预测 |

示例对比(延迟时间 5 秒):

| 时间 | 滑动窗口 | 固定窗口 | |------|----------|----------| | 0s | 用户A 加入,等待到 5s | 用户A 加入,等待到 5s | | 2s | 用户B 加入,重置等待到 7s | 用户B 加入,仍等待到 5s | | 4s | 用户C 加入,重置等待到 9s | 用户C 加入,仍等待到 5s | | 发送时间 | 9s(3 个用户) | 5s(3 个用户) |

合并时变量处理规则:

  • {user}、{id}:用顿号(、)分隔全部列出
  • {at}:为每个用户生成 @ 元素
  • {avatar}:每个用户头像换行显示
  • {group_count}:取最新群人数
  • {time}:取最后事件的时间
  • {hitokoto}:只获取一次

从旧版本迁移

若你此前使用 koishi-plugin-multi-bot-controller-groupwelcome-message:

  1. 卸载旧插件,安装本插件
  2. 配置不再从 multi-bot-controller 的下拉列表中选择 Bot,改为手动填写平台名称与Bot 自身账号 ID(两者均可在控制台-机器人列表中查看)
  3. 其余配置(延迟模式、消息模板、群组 ID)格式不变,但需在新插件下重新填写

依赖项

License

MIT