npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

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