discord-protect
v2.1.0
Published
Module Protect for Discord
Downloads
3
Readme
Discord-Protect
Protection :
AntiBot
const Discord = require('discord.js');
const Client = new Discord.Client({ intents: 32767 });
const Protect = require("discord-protect");
Client.login("TOKEN");
Client.on('ready', () => console.log(`${Client.user.tag} en ligne!`));
Client.on('guildMemberAdd', member => {
const CheckBot = Protect.AntiBot({ Member: member });
if(CheckBot === true) {
return member.kick("Cet utilisateur est un robot.");
/*
Modérer un membre discord: https://discord.js.org/#/docs/discord.js/13.8.0/class/GuildMember
*/
};
});
AntiLink
const Discord = require('discord.js');
const Client = new Discord.Client({ intents: 32767 });
const Protect = require("discord-protect");
Client.login("TOKEN");
Client.on('ready', () => console.log(`${Client.user.tag} en ligne!`));
Client.on('messageCreate', message => {
const isLink = Protect.AntiLink({ Message: message });
if(isLink === true) {
if(message.deletable) {
return message.delete();
/*
Modérer un message d'un membre discord: https://discord.js.org/#/docs/discord.js/13.8.0/class/Message
*/
};
};
});
AntiSpam
const Discord = require('discord.js');
const Client = new Discord.Client({ intents: 32767 });
const Protect = require("discord-protect");
const AntiSpamSettings = new Protect.AntiSpamSettings({ Warn: { Messages: 3 }, Sanction: { Messages: 5 }, TimeoutDeleteCollection: 10000 });
Client.login("TOKEN");
Client.on('ready', () => console.log(`${Client.user.tag} en ligne!`));
Client.on('messageCreate', async message => {
if(message.author.id === Client.user.id) return;
const isAntispam = await AntiSpamSettings.AntiSpam({ Message: message });
if(isAntispam === "TYPE_SANCTION") {
return message.member.kick();
/*
Modérer un membre discord: https://discord.js.org/#/docs/discord.js/main/class/GuildMember
*/
} else if(isAntispam === "TYPE_WARN") {
return message.reply({ content: "ATTENTION | Le système d'anti-spam trouve ton comportement de type Spam!" });
};
});
AntiPing
const Discord = require('discord.js');
const Client = new Discord.Client({ intents: 32767 });
const Protect = require("discord-protect");
Client.login("TOKEN");
Client.on('ready', () => console.log(`${Client.user.tag} en ligne!`));
Client.on('messageCreate', message => {
const contentPingMessage = Protect.AntiPing({ Message: message, Number: "Valeur numérale" });
if(contentPingMessage === true) {
if(message.deletable) {
return message.delete();
/*
Modérer un message d'un membre discord: https://discord.js.org/#/docs/discord.js/13.8.0/class/Message
*/
};
};
});
AntiAccountAge :
const Discord = require('discord.js');
const Client = new Discord.Client({ intents: 32767 });
const Protect = require("discord-protect");
Client.login("TOKEN");
Client.on('ready', () => console.log(`${Client.user.tag} en ligne!`));
Client.on('guildMemberAdd', member => {
const isAgeNoRequired = Protect.CheckAccountAge({ Member: member, Age: "7d" })
if(isAgeNoRequired === true) {
member.kick();
/*
Modérer un membre discord: https://discord.js.org/#/docs/discord.js/13.8.0/class/GuildMember
*/
};
});
CheckCapital :
const Discord = require('discord.js');
const Client = new Discord.Client({ intents: 32767 });
const Protect = require("discord-protect");
Client.login("TOKEN");
Client.on('ready', () => console.log(`${Client.user.tag} en ligne!`));
Client.on('messageCreate', message => {
if(message.author.id === Client.user.id) return;
const ObjectCapitalMessage = Protect.CheckCapitalMessage({ Message: message, Length: 5 });
if(ObjectCapitalMessage === null) return;
if(ObjectCapitalMessage.LengthTrue.Math >= 50) {
if(message.deletable) {
message.delete();
/*
Modérer un message d'un membre discord: https://discord.js.org/#/docs/discord.js/13.8.0/class/Message
*/
};
};
});
Modération :
CheckStatus :
const Discord = require('discord.js');
const Client = new Discord.Client({ intents: 32767 });
const Moderation = require("discord-protect");
Client.login("TOKEN");
Client.on('ready', () => console.log(`${Client.user.tag} en ligne!`));
Client.on('messageCreate', message => {
if(!message.content.startsWith("checkstatus")) return;
if(message.author.bot) return;
const Embed = new Discord.MessageEmbed().setColor("BLURPLE");
const User = Moderation.CheckStatus({ Message: message, Content: "https://discord.gg/hsmD2Q3mjS" });
User.slice(0, 20).map(Value => {
Embed.addField(Value.Member.user.tag, `Status: \`${Value.Presence.state}\``);
});
if(Embed.fields.length === 0) {
return message.channel.send({ content: ":x: **Aucun statut avec ce contenu est trouvé!**" });
};
return message.channel.send({ embeds: [Embed] });
/*
Options:
Message: Discord Message
Content: String
*/
});
Snipe :
const Discord = require('discord.js');
const Client = new Discord.Client({ intents: 32767 });
const Moderation = require("discord-protect");
Client.login("TOKEN");
Client.on('ready', () => console.log(`${Client.user.tag} en ligne!`));
Client.on('messageDelete', message => {
return Moderation.Snipe.Event({ Message: message });
/*
Options:
Message: Discord Message
*/
});
Client.on('messageCreate', message => {
if(!message.content.startsWith("snipe")) return;
const Snipe = Moderation.Snipe.Command({ Channel: message.channel });
if(Snipe === undefined) return message.channel.send({ content: "Aucun message trouvé!" });
return console.log(Snipe);
/*
Options:
Channel: Discord Channel
*/
});
Advanced Clear :
const Discord = require('discord.js');
const Client = new Discord.Client({ intents: 32767 });
const Moderation = require("discord-protect");
Client.login("TOKEN");
Client.on('ready', () => console.log(`${Client.user.tag} en ligne!`));
Client.on('messageCreate', async message => {
if(!message.content.startsWith("clear")) return;
return await Moderation.Clear(message.channel, 500);
/*
Options:
Channel: Discord Channel
Number: Number delete message
*/
});
Tempban :
const Discord = require('discord.js');
const Client = new Discord.Client({ intents: 32767 });
const Moderation = require("discord-protect");
Client.login("TOKEN");
Client.on('ready', () => {
console.log(`${Client.user.tag} en ligne!`);
return Moderation.Tempban.Event({ Storage: "./Example.json", Client: Client });
/*
Options:
(no required) Storage: Use Specified Json File
Client: Discord Bot
*/
});
Client.on('messageCreate', async message => {
if(!message.content.startsWith("ban")) return;
return Moderation.Tempban.Command({ Storage: "./Example.json", Message: message, Member: "MemberID", Duration: "5d", Reason: "Manque de respect!" });
/*
Options:
(no required) Storage: Use Specified Json File
Message: Discord Message
Member: Discord MemberID
Duration: Duration
(no required) Reason: Reason
*/
});
Tempban'JsonFile :
{}
Support:
Notre support est présent sur le support de mon bot Discord (Winter): https://discord.gg/tZ2nAMujjs
By: Kurama#0001