diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..602bf99
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,18 @@
+# Contributing to Discord-anti-spam (DAS)
+👍🎉 First off, thanks for taking the time to contribute! 🎉👍
+
+#### Table Of Contents
+
+[Code of Conduct](#code-of-conduct)
+
+## How Can I Contribute?
+
+### Reporting Bugs
+
+This section guides you through submitting a bug report for Atom. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports :mag_right:.
+
+> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
+
+### Creating pr's
+
+Make sure to keep it clear so that the team and see it clear what you change. You're not required to keep it short but it's recommended! Also every pr needs a review before merge by a maintainer.
diff --git a/README.md b/README.md
index 9ac2972..432e7de 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,7 @@
# discord-anti-spam.js
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**
## Installation
@@ -21,37 +22,73 @@ You can see the package documentation [**here**](https://discord-anti-spam.js.or
Example of a basic bot handling spam messages using this module.
```js
-const Discord = require('discord.js');
-const client = new Discord.Client();
-const AntiSpam = require('discord-anti-spam');
+const Discord = require("discord.js");
+const client = new Discord.Client({
+ intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES],
+});
+const AntiSpam = require("discord-anti-spam");
const antiSpam = new AntiSpam({
- warnThreshold: 3, // Amount of messages sent in a row that will cause a warning.
- muteThreshold: 4, // Amount of messages sent in a row that will cause a mute
- kickThreshold: 7, // Amount of messages sent in a row that will cause a kick.
- banThreshold: 7, // 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.
- maxDuplicatesKick: 10, // Amount of duplicate messages that trigger a warning.
- maxDuplicatesBan: 12, // Amount of duplicate messages that trigger a warning.
- maxDuplicatesMute: 8, // Ammount of duplicate message that trigger a mute.
- 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.
- muteRoleName: "Muted", // Name of the role that will be given to muted users!
- removeMessages: true // If the bot should remove all the spam messages when taking action on a user!
- // And many more options... See the documentation.
+ warnThreshold: 3, // Amount of messages sent in a row that will cause a warning.
+ muteThreshold: 4, // Amount of messages sent in a row that will cause a mute
+ kickThreshold: 7, // Amount of messages sent in a row that will cause a kick.
+ banThreshold: 7, // 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.
+ maxDuplicatesKick: 10, // Amount of duplicate messages that trigger a warning.
+ maxDuplicatesBan: 12, // Amount of duplicate messages that trigger a warning.
+ maxDuplicatesMute: 8, // Ammount of duplicate message that trigger a mute.
+ 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.
+ muteRoleName: "Muted", // Name of the role that will be given to muted users!
+ timeMute: 0, // 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: "mod-logs", // channel to send the modlogs too!
+ modLogsMode: "embed",
+ // And many more options... See the documentation.
});
-client.on('ready', () => console.log(`Logged in as ${client.user.tag}.`));
+client.on("ready", () => console.log(`Logged in as ${client.user.tag}.`));
-client.on('message', (message) => antiSpam.message(message));
+client.on("messageCreate", (message) => antiSpam.message(message));
-client.login('YOUR_SUPER_SECRET_TOKEN');
+client.login("YOUR_SUPER_SECRET_TOKEN");
+```
+
+## Example (As a direct copy template without explanations)
+
+```js
+const antiSpam = new AntiSpam({
+ warnThreshold: 3,
+ muteThreshold: 4,
+ kickThreshold: 7,
+ banThreshold: 7,
+ maxInterval: 2000,
+ warnMessage: "{@user}, Please stop spamming.",
+ kickMessage: "**{user_tag}** has been kicked for spamming.",
+ muteMessage: "**{user_tag}** has been muted for spamming.",
+ banMessage: "**{user_tag}** has been banned for spamming.",
+ maxDuplicatesWarning: 6,
+ maxDuplicatesKick: 10,
+ maxDuplicatesBan: 12,
+ maxDuplicatesMute: 8,
+ ignoredPermissions: ["ADMINISTRATOR"],
+ ignoreBots: true,
+ verbose: true,
+ ignoredMembers: [],
+ muteRoleName: "Muted",
+ muteTime: 0,
+ removeMessages: true,
+ modLogsEnabled: false,
+ modLogsChannelName: "mod-logs",
+ modLogsMode: "embed",
+});
```
## Support Server
@@ -62,8 +99,8 @@ Join our [Support Server](https://discord.gg/KQgDfGr) where we help you with iss
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 © 2019 [Michael-J-Scofield](https://github.com/Michael-J-Scofield)
This project is MIT licensed.
diff --git a/docs/index.html b/docs/index.html
index 8192c5d..dfe2930 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -61,9 +61,9 @@
You can see the package documentation here.
Example of a basic bot handling spam messages using this module.
+Example of a basic bot handling spam messages using this module.\n
The module only supports discord.js v13 and the required intents are: "GUILD_MESSAGES"
const Discord = require('discord.js');
-const client = new Discord.Client();
+const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILDS,Discord.Intents.FLAGS.GUILD_MESSAGES] });
const AntiSpam = require('discord-anti-spam');
const antiSpam = new AntiSpam({
warnThreshold: 3, // Amount of messages sent in a row that will cause a warning.
@@ -90,7 +90,7 @@ Example
client.on('ready', () => console.log(`Logged in as ${client.user.tag}.`));
-client.on('message', (message) => antiSpam.message(message));
+client.on('messageCreate', (message) => antiSpam.message(message));
client.login('YOUR_SUPER_SECRET_TOKEN');
@@ -116,4 +116,4 @@