Overview & Impact
The Ghost Ping Detector is a specialised open-source utility built for Discord bot developers to solve the problem of ghost pings - mentions that are deleted or edited out of a message before the target user can see them. By providing a reliable detection mechanism, the tool helps maintain transparency in large community servers and reduces user frustration.
The package is actively maintained and has achieved significant adoption, highlighted by the following metrics:
- Lifetime NPM Downloads: 26,824
- GitHub Stars: 15
Architecture & Features
The project is built using TypeScript to provide strict type safety and a better developer experience through auto-completion and error checking. It operates by hooking into the DiscordJS event lifecycle to monitor real-time state changes in messages.
Intelligent Type Guarding: Implements rigorous TypeScript type guards (like isEligible) to verify message eligibility, automatically ignoring bot-authored messages and self-pings to optimise event-loop performance.
Features
Real-Time Detection: Instantly detect when a user has been ghost-pinged, providing an immediate alert whenever a recent message with a mention is deleted or altered.User Notifications: Enables developers to provide timely and helpful messages to users, informing them that they were ghost-pinged and by whom.Comprehensive Telemetry: Returns a structured ReturnObject containing the author, channel, and specific mentions, allowing for easy piping into logs or moderation databases.
Repository & Links
You can view the source code and contribute to the project directly on GitHub.
GitHub Repository: https://github.com/ThatsLiamS/discord.js-ghost-ping
NPM Package: https://www.npmjs.com/package/discord.js-ghost-ping