/discord.js-ghost-ping

Detect Ghost Pings inside of discord.js, with tens of thousands of NPM downloads!

Primary LanguageTypeScriptMIT LicenseMIT

Verison Downloads npm bundle size

Getting Started

About

=Introducing the Ghost Ping Detector, a powerful tool designed specifically for Discord bot developers. Created by a 4-time verified bot developer who has reached millions of users across Discord, this package is your definitive solution for detecting and alerting users to ghost pings.

Features

  • Real-Time Detection: Instantly detect when a user has been ghost pinged in a channel. The Ghost Ping Detector immediately alerts your bot whenever a recent message with a mention is deleted.
  • User Notifications: Provide timely and helpful messages to users, informing them that they were ghost pinged.
  • Easy Integration: Seamlessly install and integrate the Ghost Ping Detector into your existing Discord bot. Compatible with all major DiscordJS versions.
  • Developer-Friendly: Suitable for both seasoned bot developers and those just starting out.

Why Choose Ghost Ping Detector?

  • Reliable and Efficient: Ensure your bot is more responsive and user-friendly with real-time ghost ping detection.
  • Enhanced User Experience: Improve your server's environment by keeping users informed and reducing frustration caused by ghost pings.

Help

For more information on how to use the package, please refer to the complete documentation on the repository wiki pages. If you have any questions or run into any issues, we also have a Discord server where you can ask the community and the developer for help.

Installation

Install with npm:

$ npm install discord.js-ghost-ping

Install with yarn:

$ yarn add discord.js-ghost-ping

Example Usage

This is a working example.

const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages] });

const GhostPing = require('discord.js-ghost-ping');

client.on('messageDelete', (...args) => {
	const res = GhostPing('messageDelete', ...args);
	console.log(res ? res.mentions : false);
});

client.on('messageUpdate', (...args) => {
	const res = GhostPing('messageUpdate', ...args);
	console.log(res ? res.mentions : false);
});

client.login(process.env['MyToken']);