Skip to content

Commit

Permalink
v3.0.0
Browse files Browse the repository at this point in the history
Add: 
- Change mutes to use the timeout feature added recently by discord
- Individual options for guilds

Fix:
- Converted unMuteTime property to ms
- Fixed errors
- New docs (New design coming soon)
  • Loading branch information
Scraayp authored Jan 10, 2022
2 parents 29aebc1 + ba9549d commit ef495fe
Show file tree
Hide file tree
Showing 7 changed files with 638 additions and 186 deletions.
48 changes: 43 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ const antiSpam = new AntiSpam({
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.
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: "mod-logs", // channel to send the modlogs too!
Expand Down Expand Up @@ -82,15 +81,54 @@ const antiSpam = new AntiSpam({
ignoreBots: true,
verbose: true,
ignoredMembers: [],
muteRoleName: "Muted",
muteTime: 0,
unMuteTime: 10,
removeMessages: true,
modLogsEnabled: false,
modLogsChannelName: "mod-logs",
modLogsMode: "embed",
});
```

## Multiple Guild Example
Because of a new update, you may now have multiple guilds having their own options. You will need to store their options in a database or something similar to avoid loss of settings.
```js
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,
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: [],
unMuteTime: 10,
removeMessages: true,
modLogsEnabled: false,
modLogsChannelName: "mod-logs",
modLogsMode: "embed",
}); // If a guild does not have any separate options, these are the settings they will be using.

client.on("ready", () => antiSpam.addGuildOptions(client.guilds.fetch("583920432168828938"), {modLogsChannelName: "special-logs"}))
client.on("messageCreate", (message) => antiSpam.message(messageCreate));
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.
Expand All @@ -104,4 +142,4 @@ If you have any bugs or trouble setting the module up, feel free to open an issu
Copyright © 2019 [Michael-J-Scofield](https://github.com/Michael-J-Scofield)<br />
This project is MIT licensed.

---
---
Loading

0 comments on commit ef495fe

Please sign in to comment.