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

dezirehandler.js

v1.0.2

Published

Is one of the easiest command handlers for Discord.js V12 with alot of features from arguments, error messages, permissions and much more!

Downloads

1

Readme

DezireHandler.js v1.0.2

Is one of the easiest command handlers for Discord.js V12 with alot of features from arguments, error messages, permissions and much more!

DezireHandler Examples

Install

npm install dezirehandler.js@latest

Example

Setup

const Discord = require("discord.js");
const client = new Discord.Client();
const cmd = require("dezirehandler.js");

const handler = new cmd.Handler({
  folder: "./commands", //required
  client: client, //required
  prefix: "dh!", //required
  owner: ["The owner ID"], //required, add more owner ID's if you would like
});

handler.start();
client.login(process.env.TOKEN);

Standard using example

const Discord = require("discord.js");

module.exports = {
  name: "ping",
  description: "Ping!!",
  code: (message, args, client) => {
    //Your code here
    message.channel.send("Pong");
  },
};

Cooldown example

const Discord = require("discord.js");

module.exports = {
  name: "ping",
  cooldown: {
    time: 3,
  },
  description: "Ping!",
  code: (message, args, client) => {
    //Your code here
    message.channel.send("Pong");
  },
};

Error example

const Discord = require("discord.js");

module.exports = {
  name: "error",
  cooldown: {
    time: 3,
    errorMsg:
      "You can use the `{command.name}` after {time} seconds.",
    deletable: true,
  },
  description: "This is a error message",
  code: (message, args, client) => {
    //Your code here
    message.channel.send("Error message example");
  },
};

Aliases example

const Discord = require("discord.js");

module.exports = {
  name: "ping",
  aliases: ["delay"],
  description: "Check if the bot is online",
  code: (message, args, client) => {
    //Your code here
    message.channel.send("Pong");
  },
};

Usage and Args example

const Discord = require("discord.js");

module.exports = {
  name: "ping",
  args: "1", //required
  usage: "bot",
  description: "Ping!",
  code: (message, args, client) => {
    //Your code here
    message.channel.send("Pong");
  },
};

Require permission & Require args

const Discord = require("discord.js");

module.exports = {
  name: "ban",
  permission: {
    perm: "BAN_MEMBERS",
    deletable: true,
  },
  args: 1,
  description: "Ban the mentioned member",
  code: (message, args, client) => {
    //Your code here
message.guild.member.ban(message.mention.first());
  },
};

Guild only command example

const Discord = require("discord.js");

module.exports = {
  name: "guildonly",
  guildOnly: {
    status: true,
  },
  description: "The guild only example",
  code: (message, args, client) => {
	  //Your code here
message.channel.send(`${message.guild.name}`);
  },
};

Owner only command example

const Discord = require("discord.js");

module.exports = {
  name: "server-icon",
  ownerOnly: {
    status: true,
    deletable: false,
  },
  description: "Get the server icon"
  code: (message, args, client) => {
    //Your code here
    message.channel.send(
      message.guild.iconURL({ display: true, format: "png" })
    );
  },
};

Keys

  • {user.id} - return message.author.id
  • {user.name} - return message.author.username
  • {user.discrim} - return message.author.discriminator
  • {command.name} - return used command name
  • {time} - return left time from cooldowns (only cooldowns)
  • {perm} - return require perm for use command (only for require permission)