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 🙏

© 2025 – Pkg Stats / Ryan Hefner

koishi-plugin-gcard-keeper

v1.0.0

Published

检测群名片修改并发送通知,并能自动修改回设定名片(Bot)与原名片(群员),支持正则表达式配置违禁词

Readme

koishi-plugin-gcard-keeper

npm

检测群名片修改并发送通知,并能自动修改回设定名片(Bot)与原名片(群员),支持正则表达式配置违禁词

✨ 功能特性

  • 群名片变更通知: 当群名片发生变化时,可发送通知到指定位置(原群、其他群聊或私聊)。
  • 机器人名片保护: 自动恢复机器人自身的群名片,可配置在启动时或被修改时恢复,并支持排除特定群聊。
  • 违规名片恢复: 根据设置的正则表达式,自动恢复成员的违规群名片 (需要机器人是管理员)。
  • 高度可配置: 支持自定义通知消息模板、分群配置违规关键词等。

📝 配置选项

notification

  • 功能: 设置群名片变更通知的发送位置。
  • 可选值:
    • 关闭 (默认): 不发送任何通知。
    • 开启 (原群): 在名片变更发生的群聊内发送通知。
    • 开启 (指定目标): 发送到指定的群聊或私聊。格式为 guild:群号private:QQ号
      • 示例: guild:12345678private:87654321

notificationMessage

  • 功能: 自定义通知消息的内容模板。
  • 默认值: {guildName}({guildId}) 中 {userName}({userId}) 的名片由 {oldCard} 更新为 {newCard}
  • 可用变量:
    • {userName}: 成员的昵称。
    • {userId}: 成员的 QQ 号。
    • {guildName}: 群聊的名称。
    • {guildId}: 群聊的群号。
    • {oldCard}: 变更前的旧名片 (如果没有则为 "无")。
    • {newCard}: 变更后的新名片 (如果没有则为 "无")。

botNickname

  • 功能: 设置机器人需要保持的固定群名片。
  • 依赖: 此项只有在 autoRevertBotNickname 启用时才有效。
  • 示例: 机器人-小K

revertOnReady

  • 功能: 在插件启动时,自动将所有群聊中机器人的名片设置为 botNickname 中指定的值。
  • 默认值: false (关闭)
  • 依赖: autoRevertBotNickname 必须为 true

revertOnUpdate

  • 功能: 在机器人群名片被他人修改后,自动将其恢复为 botNickname 中指定的值。
  • 默认值: false (关闭)
  • 依赖: autoRevertBotNickname 必须为 true

revertForbidden

  • 功能: 是否启用违规群名片的自动恢复功能。
  • 默认值: false (关闭)
  • 注意: 启用此功能需要机器人在对应群聊拥有管理员权限。

revertExcludeGuilds

  • 功能: 配置一个群号列表,在这些群聊中,将不会自动恢复机器人自身的名片。
  • 格式: 一个字符串数组,每个元素是一个群号。
  • 示例: ['11111111', '22222222']

forbiddenKeywords

  • 功能: 配置违规群名片的检测规则,需要将 revertForbidden 设置为 true 才会生效。
  • 格式: 一个表格,左侧填写群号,右侧填写用于匹配违规名片的正则表达式
  • 示例:

| 群号 | 正则表达式 | 说明 | | :--------- | :-------------------- | :--------------------------------------------------------- | | 12345678 | 广告 | 在群 12345678 中,任何包含 "广告" 的新名片都将被恢复。 | | 87654321 | ^(?!官方\|管理).*$ | 在群 87654321 中,禁止名片以 "官方" 或 "管理" 开头。 |