Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michael-j-scofield/discord-anti-spam
A simple discord anti spam node.js module to prevent spam on your discord server
https://github.com/michael-j-scofield/discord-anti-spam
discord discord-js moderation spam-protection
Last synced: 2 days ago
JSON representation
A simple discord anti spam node.js module to prevent spam on your discord server
- Host: GitHub
- URL: https://github.com/michael-j-scofield/discord-anti-spam
- Owner: Michael-J-Scofield
- License: mit
- Created: 2017-07-28T19:30:39.000Z (over 7 years ago)
- Default Branch: development
- Last Pushed: 2023-07-27T11:47:06.000Z (over 1 year ago)
- Last Synced: 2024-05-01T14:41:50.493Z (8 months ago)
- Topics: discord, discord-js, moderation, spam-protection
- Language: JavaScript
- Size: 900 KB
- Stars: 147
- Watchers: 10
- Forks: 52
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# discord-anti-spam.js
A simple module with quick setup and different options to implement anti-spam features in your bot.
## Installation
To install this module type the following command in your console:
```
npm i discord-anti-spam
```## Documentation
You can see the package documentation [**here**](https://discord-anti-spam.js.org).
## Example
Example of a basic bot handling spam messages using this module.
```js
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.
ipwarnEnabled: false, //whether to delete ip addresses in channels or not.
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");
```## Support Server
Join our [Support Server](https://discord.gg/KQgDfGr) where we help you with issues regarding the module.
## Bug Reports
If you have any bugs or trouble setting the module up, feel free to open an issue on [Github](https://github.com/Michael-J-Scofield/discord-anti-spam)
## 📝 License
Copyright © 2024 [Michael-J-Scofield](https://github.com/Michael-J-Scofield)
This project is MIT licensed.---