Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
@devraelfreeze/discordjs-antispam
Advanced tools
A simple module with quick setup and different options to implement anti-spam features in your bot.
This version of the package will only support discord.js v13
To install this module type the following command in your console:
npm i @devraelfreeze/discordjs-antispam
const Discord = require("discord.js");
const client = new Discord.Client({
intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES],
});
const AntiSpam = require("@devraelfreeze/discordjs-antispam");
const antiSpam = new AntiSpam(client , {
customGuildOptions: false, // Use custom Guild Options or not
warnThreshold: 4, // Amount of messages sent in a row that will cause a warning.
muteThreshold: 6, // Amount of messages sent in a row that will cause a mute
kickThreshold: 8, // Amount of messages sent in a row that will cause a kick.
banThreshold: 10, // Amount of messages sent in a row that will cause a ban.
maxInterval: 2000, // Amount of time (in milliseconds) in which messages are considered spam.
warnMessage: "{@user}, Please stop spamming.", // Message that will be sent in chat upon warning a user.
kickMessage: "**{user_tag}** has been kicked for spamming.", // Message that will be sent in chat upon kicking a user.
muteMessage: "**{user_tag}** has been muted for spamming.", // Message that will be sent in chat upon muting a user.
banMessage: "**{user_tag}** has been banned for spamming.", // Message that will be sent in chat upon banning a user.
maxDuplicatesWarning: 6, // Amount of duplicate messages that trigger a warning.
maxDuplicatesMute: 8, // Ammount of duplicate message that trigger a mute.
maxDuplicatesKick: 10, // Amount of duplicate messages that trigger a kick.
maxDuplicatesBan: 12, // Amount of duplicate messages that trigger a ban.
ignoredPermissions: ["ADMINISTRATOR"], // Bypass users with any of these permissions.
ignoreBots: true, // Ignore bot messages.
verbose: true, // Extended Logs from module.
ignoredMembers: [], // Array of User IDs that get ignored.
unMuteTime: 10, // Amount of time (in minutes) a user will be muted for.
removeMessages: true, // If the bot should remove all the spam messages when taking action on a user!
modLogsEnabled: false, // If to enable modlogs
modLogsChannelName: "CHANNEL_ID", // channel ID to send the logs
// And many more options...
});
/** Listeners */
client.on("ready", () => console.log(`Logged in as ${client.user.tag}.`));
client.on("messageCreate", async (message) => {
await antiSpam.message(message);
});
/** Login the bot */
client.login("VERY SECRET TOKEN HERE :)");
const Discord = require("discord.js");
const client = new Discord.Client({
intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES],
});
const AntiSpam = require("@devraelfreeze/discordjs-antispam");
const antiSpam = new AntiSpam(client, {customGuildOptions: true});
/** Listeners */
client.on("ready", () => console.log(`Logged in as ${client.user.tag}.`));
client.on("messageCreate", async (message) => {
/** Custom guild options in Object format. */
const guildOptions = {
warnThreshold: 4, // Amount of messages sent in a row that will cause a warning.
muteThreshold: 6, // Amount of messages sent in a row that will cause a mute
kickThreshold: 8, // Amount of messages sent in a row that will cause a kick.
banThreshold: 10, // Amount of messages sent in a row that will cause a ban.
maxInterval: 2000, // Amount of time (in milliseconds) in which messages are considered spam.
warnMessage: "{@user}, Please stop spamming.", // Message that will be sent in chat upon warning a user.
kickMessage: "**{user_tag}** has been kicked for spamming.", // Message that will be sent in chat upon kicking a user.
muteMessage: "**{user_tag}** has been muted for spamming.", // Message that will be sent in chat upon muting a user.
banMessage: "**{user_tag}** has been banned for spamming.", // Message that will be sent in chat upon banning a user.
maxDuplicatesWarning: 6, // Amount of duplicate messages that trigger a warning.
maxDuplicatesMute: 8, // Ammount of duplicate message that trigger a mute.
maxDuplicatesKick: 10, // Amount of duplicate messages that trigger a kick.
maxDuplicatesBan: 12, // Amount of duplicate messages that trigger a ban.
ignoredPermissions: ["ADMINISTRATOR"], // Bypass users with any of these permissions.
ignoreBots: true, // Ignore bot messages.
verbose: true, // Extended Logs from module.
ignoredMembers: [], // Array of User IDs that get ignored.
unMuteTime: 10, // Amount of time (in minutes) a user will be muted for.
removeMessages: true, // If the bot should remove all the spam messages when taking action on a user!
modLogsEnabled: false, // If to enable modlogs
modLogsChannelName: "CHANNEL_ID", // channel ID to send the logs
// And many more options...
};
await antiSpam.message(message, guildOptions);
});
/** Login the bot */
client.login("VERY SECRET TOKEN HERE :)");
Words Filter System
(Can configure the words list to filter)Discord Anti Links System
Anti Links System
(Can configure the links to be checked)Mass Mentions System
Emojis excessifs System
// TODO
If you have any bugs or trouble setting the module up, feel free to open an issue on Github Repository
Freeze#0123
If you want to use old version, you can use command
npm i @devraelfreeze/discordjs-antispam@<version>
Copyright © 2022 devRael1
This project is MIT licensed.
This is not an official Discord product. It is not affiliated with or endorsed by Discord Inc.
FAQs
Complex Antispam & AutoMod module for Discord JS v13 & v14
The npm package @devraelfreeze/discordjs-antispam receives a total of 0 weekly downloads. As such, @devraelfreeze/discordjs-antispam popularity was classified as not popular.
We found that @devraelfreeze/discordjs-antispam demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.