Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to Timeouts #150

Merged
merged 8 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!
unMuteTime: 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",
unMuteTime: 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