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

adb-plugin-automod

v1.0.0

Published

automod plugin for ADB

Readme

adb-plugin-automod

Content filtering plugin with configurable rules, whitelists, and actions for Advanced Discord Bot (ADB).

Features

  • Filter Pipeline (Optimized, fast checks run first):

    • Invite: Blocks Discord invite links (e.g. discord.gg/code).
    • Link: Blocks external URLs, supporting a domain whitelist.
    • Caps: Flags messages exceeding a threshold of uppercase characters (default: 70%).
    • Mention: Flags messages containing too many @member mentions (default: 5).
    • Emoji: Flags messages containing too many emojis (Unicode and custom, default: 5).
    • Word: Blocks bad words/phrases supporting wildcards (e.g. *bad*, exactword, starts*).
    • Spam: Detects rapid messaging, consecutive duplicate messages, and repeated duplicate characters.
  • Action Suite:

    • delete: Deletes the offending message.
    • warn: Deletes the message, issues a guild warning to the user's profile, DMs the user, and logs the incident.
    • mute: Deletes the message, applies a standard 10-minute timeout to the user, DMs the user, and logs the incident.
    • timeout: Deletes the message, applies a custom-duration timeout to the user, DMs the user, and logs the incident.
    • log: Deletes the message and logs the incident to the configured moderation log channel.
  • Whitelisting:

    • Excludes channels or roles from specific filters (or all filters entirely).

Commands

  • /automod rule add [type] [action] [threshold?] [words?] [duration?]
    • Adds a new rule for a filter type.
  • /automod rule remove [rule_id|type]
    • Removes a rule by its database ID or filter type name.
  • /automod rule edit [rule_id|type] [action?] [threshold?] [words?] [duration?] [enabled?]
    • Edits an existing rule's configuration.
  • /automod list
    • Lists all configured AutoMod rules and whitelists.
  • /automod whitelist [type] [filter] [channel?] [role?]
    • Toggles a whitelist entry for a channel or role.
  • /automod action [type] [action?]
    • Views or sets the action for a given filter type.

Project Structure

adb-plugin-automod/
├── plugin.json         # Manifest file with bot permissions
├── index.js            # Entry point: registers commands/models, listens to messageCreate
├── commands/
│   └── automod.js      # Slash command handling
├── models/
│   ├── rule.js         # AutoModRule Mongoose schema
│   └── whitelist.js    # Whitelist Mongoose schema
├── lib/
│   └── parseDuration.js # Shared utility for duration parsing
└── test/
    ├── mock-ctx.js     # Mock plugin context for offline testing
    └── local-harness.js # Offline test harness

Testing

Run tests locally without requiring a live Discord connection or MongoDB database:

npm install
npm test

License

This project is licensed under the GNU Affero General Public License v3.0. See the LICENSE file for details.