Advertisement
Guest User

Spam

a guest
Oct 23rd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const client = new Discord.Client();
  3. const DiscordAntiSpam = require("discord-anti-spam");
  4. const AntiSpam = new DiscordAntiSpam({
  5. warnThreshold: 3, // Amount of messages sent in a row that will cause a warning.
  6. banThreshold: 7, // Amount of messages sent in a row that will cause a ban
  7. maxInterval: 2000, // Amount of time (in ms) in which messages are cosidered spam.
  8. warnMessage: "{@user}, cher humain veuillez arrêté de spammer.", // Message will be sent in chat upon warning.
  9. banMessage: "**{user_tag}** a été banni pour spamming.", // Message will be sent in chat upon banning.
  10. maxDuplicatesWarning: 3, // Amount of same messages sent that will be considered as duplicates that will cause a warning.
  11. maxDuplicatesBan: 5, // Amount of same messages sent that will be considered as duplicates that will cause a ban.
  12. deleteMessagesAfterBanForPastDays: 1, // Amount of days in which old messages will be deleted. (1-7)
  13. exemptPermissions: ["MANAGE_MESSAGES", "ADMINISTRATOR", "MANAGE_GUILD", "BAN_MEMBERS"], // Bypass users with at least one of these permissions
  14. ignoreBots: true, // Ignore bot messages
  15. verbose: false, // Extended Logs from module
  16. ignoredUsers: [], // Array of string user IDs that are ignored
  17. ignoredGuilds: [], // Array of string Guild IDs that are ignored
  18. ignoredChannels: [] // Array of string channels IDs that are ignored
  19. });
  20.  
  21. AntiSpam.on("warnEmit", (member) => console.log(`Attempt to warn ${member.user.tag}.`));
  22. AntiSpam.on("warnAdd", (member) => console.log(`${member.user.tag} has been warned.`));
  23. AntiSpam.on("kickEmit", (member) => console.log(`Attempt to kick ${member.user.tag}.`));
  24. AntiSpam.on("kickAdd", (member) => console.log(`${member.user.tag} has been kicked.`));
  25. AntiSpam.on("banEmit", (member) => console.log(`Attempt to ban ${member.user.tag}.`));
  26. AntiSpam.on("banAdd", (member) => console.log(`${member.user.tag} has been banned.`));
  27. AntiSpam.on("dataReset", () => console.log("Le cache du module a été supprimé."));
  28.  
  29. client.on("ready", () => console.log(`Logged in as ${client.user.tag}.`));
  30.  
  31. client.on("message", (msg) => {
  32. AntiSpam.message(msg);
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement