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

atomic-handler

v0.0.6

Published

Powerful slash-command/normal-commands handler with args, respond and music system πŸš€πŸ”₯.

Downloads

1

Readme

ATOM Handler πŸ’«πŸŒ 

Installation πŸ”§

npm i atomic-handler

why ATOM-Handler πŸ€”

  1. powerful and easy to use ..
  2. make a normal command and slash-command in the same file ..
  3. Erela.js music system ..
  4. custom and easer respond system

Docs πŸ‘¨β€πŸ’»

Index File πŸ’«
// require the ATOMIC-Handler πŸš€πŸ’«
const ATOM = require("atomic-handler");

// makes the starting function .
(async () => {
  // create an Discord.js(v14) client (returns a normal client);
  // your can replace the Manager with your own erela.js manager
  const client = new ATOM.Handler("<your discord bot token>", Manager);

  // register the command to a JS-Map
  // ' /commands ' the path to your commands
  // the other option have to be true or false , true for allow commands category
  // returns the commands (JS-Map)
  let commands = await client.registerCommands("/commands", true);
  // just for running the commands ..
  // option (1) ' commands ' needs the commands JS-Map
  // option (2) ' reply ' to change the default message: ' 🚫 | This option have to be one of these ....' and use {args} to replace it with the chooses
  // option (3) ' reply2 ' to change the default message: ' "🚫 | There is a missing entry that you should include next to the command: ....' and use {arg} to replace it with the missing entry
  await client.runCommands(commands);
  // run the ereal.js manger
  // replace ' node ' with an normal erela.js NodeOptions
  await client.createManager(node);

  // you can request the erela.js manager with
  client.manager;

  // you can change your default prefix which is "!" using the database

  // request the database (quick.db)
  const db = ATOM.DB;
  // then change the prefix using this line to change the prefix globaly
  await db.set(`Prefix_Global`, "<your prefix>");
  // or use this line to change it in a spacific server (replace Guild.id with the server id)
  await db.set(`Prefix_${Guild.id}`, "<your prefix>");

  // you can alose request the discord.js libraray with this line
  const Discord = ATOM.DiscordJS
})();
Command File πŸ’«
const ATOM = require("atomic-handler");
const Discord = ATOM.DiscordJS;
const { Client, User, Guild, Message, TextChannel } = require("discord.js");

module.exports = {
  data: {
    name: "<command name>",
    description: "<command description>",
    type: 1, // command type
    options: [
      {
        name: "<option name>",
        type: 3, // option type
        required: true, // option required
        description: "<option description>",
      },
    ],
  }, // all this data you can find in: https://discord.com/developers/docs/interactions/application-commands#application-commands

  /**
   *
   * @param {Client<boolean>} client
   * @param {{
   * author: User, guild: Guild, message: Message, channel: TextChannel
   * }} interaction
   * @param {{name: string, value: string}[]} args
   * @param {{reply: Function, editReply: Function}} respond
   */

  run: async (client, interaction, args, { editReply, reply }) => {
    // client = DiscordJS.Client
    // interaction = all the command data you will need (auto-complete included)
    // args = an array of objects have all options includes with user entries
    // reply = function to reply for user
    // editReply = function to edit the reply

    // example
    let msgID = await reply({
      content: "What did you say??",
    });
    
    setTimeout(() => {
      editReply(
        {
          content: args[0].value + " - Right?",
        },
        msgID.id
      );
    }, 2600);
  },
};