
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
discord-anti-spam
Advanced tools
An easy to setup package that help you integration of anti-spam feature in your discord bot.
A simple module with quick setup and different options to implement anti-spam features in your bot.
To install this module type the following command in your console:
npm i discord-anti-spam
You can see the package documentation here.
Example of a basic bot handling spam messages using this module.
const { Client, GatewayIntentBits, Partial } = require("discord.js");
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages],
partials: [Partials.Channel],
});
const AntiSpam = require("discord-anti-spam");
const antiSpam = new AntiSpam({
warnThreshold: 3, // Amount of messages sent in a row that will cause a warning.
muteTreshold: 6, // Amount of messages sent in a row that will cause a mute.
kickTreshold: 9, // Amount of messages sent in a row that will cause a kick.
banTreshold: 12, // Amount of messages sent in a row that will cause a ban.
warnMessage: "Stop spamming!", // Message sent in the channel when a user is warned.
muteMessage: "You have been muted for spamming!", // Message sent in the channel when a user is muted.
kickMessage: "You have been kicked for spamming!", // Message sent in the channel when a user is kicked.
banMessage: "You have been banned for spamming!", // Message sent in the channel when a user is banned.
unMuteTime: 60, // Time in minutes before the user will be able to send messages again.
verbose: true, // Whether or not to log every action in the console.
removeMessages: true, // Whether or not to remove all messages sent by the user.
ignoredPermissions: [PermissionFlagsBits.Administrator], // If the user has the following permissions, ignore him.
// For more options, see the documentation:
});
client.on("ready", () => console.log(`Logged in as ${client.user.tag}.`));
client.on("messageCreate", (message) => antiSpam.message(message));
client.login("YOUR_SUPER_SECRET_TOKEN");
Join our Support Server where we help you with issues regarding the module.
If you have any bugs or trouble setting the module up, feel free to open an issue on Github
Copyright © 2019 Michael-J-Scofield
This project is MIT licensed.
FAQs
An easy to setup package that help you integration of anti-spam feature in your discord bot.
The npm package discord-anti-spam receives a total of 1,078 weekly downloads. As such, discord-anti-spam popularity was classified as popular.
We found that discord-anti-spam demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.