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

dismod

v1.0.5

Published

A powerful package that allows you to create auto moderation events easily! very simple and powerful to use!

Downloads

4

Readme

About

A powerful package that allows you to create auto moderation events easily! very simple and powerful to use!

Installation

npm i --save dismod

Github

https://github.com/subhiashraf912/DisMod

Example usage

const { Client } = require("discord.js");
const client = new Client();
const DisMod = require("dismod");

const autoModerator = new DisMod.Manager(client);
/*
OR YOU CAN PASS YOUR OPTIONS
const autoModerator = new DisMod.Manager(client, {
  adminCheck: true, // When it's enabled, the the events will be emitted normally when someone has administartor perms.

  bannedWords: ["hentai", "f-words"], // there are default banned words tho, if you want your own/another language, then just put them here
  
  botCheck: false, // when it's enabled, the events will be emitted normally on the bots. by default it ignores them.

ignoredUsers:["some id"] //some users to ignore.
})

THO KEEP IN MIND THAT YOU HAVE YOUR OWN EVENTS, YOU CAN SET THEM UP USING SOMETHING LIKE if (message.member.hasPermission("perms")) or if (message.author.bot)return; ETC
ALSO YOU CAN CONNECT THEM TO DATABASE AND HAVE SETTINGS FOR EACH GUILD, YOU HAVE A LOT OF OPTIONS! <3 GL WITH YOUR BOT

*/

autoModerator.on("badWordUsage", (message, usedBadWords) => {
  message.channel.send("Don't use bad word");
  //warnUserSomeHow()
  message.delete();
});
autoModerator.on("repeatedText", (message, repeatedCount) => {
  if (repeatedCount > 3) {
    message.channel.send(
      `Don't send repated text! (${repeatedCount} repeated messages!)`
    );
    //warnUserSomeHow()
  }
});
autoModerator.on("capsCheck", (message, amount) => {
  //amount is percent, example: 70% of the message are caps.
  if (message.content.length > 5 && amount >= 70) {
    message.channel.send("Don't send to much caps!");
    //warnUserSomeHow()
  }
});
autoModerator.on("emojisSpam", (message, emojisCount) => {
  if (emojisCount >= 4) {
    message.channel.send("Don't spam emoji");
    //warnUserSomeHow()
  }
});
autoModerator.on("externalLink", (message, links) => {
  const linksString = links.map((link) => ` \`${link}\` `);
  message.channel.send("Don't send external link from" + linksString);
  //warnUserSomeHow()
  message.delete();
});
autoModerator.on("fastMessageSpam", (message) => {
  message.channel.send("Don't spam messages!");
  //warnUserSomeHow()
  message.delete();
});
autoModerator.on("mentionsSpam", (message, mentionsCount) => {
  if (mentionsCount >= 4) message.channel.send("Don't spam mention!");
  //warnUserSomeHow()
});
autoModerator.on("serverInvite", (message, invites) => {
  const invitesString = invites.map((invite) => ` \`${invite}\` `);
  message.channel.send("Don't send invites!" + invitesString);
  //warnUserSomeHow()
  message.delete();
});
autoModerator.on("spoilersSpam", (message, spoilersCount) => {
  if (spoilersCount >= 3)
    message.channel.send("Don't spam spoilers!" + spoilersCount);
  //warnUserSomeHow()
});

client.login("YOUR BOT TOKEN");