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

@mrmythical/discord.js-helper

v2.0.1

Published

A package to help with developing in discord.js

Downloads

41

Readme

discord.js-helper

Easy developing in discord.js

Bugs

Please go to the issues page on github to submit a bug

Example:

const { Discord, Client, Command } = require("@mrmythical/discord.js-helper")
const { Intents } = Discord
const client = new Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
    autoListen: true
})

client.prefix = '!'
const command = new Command(client, {
    name: "test",
    aliases: ["t"]
})
command.on("execute", ({ msg }) => {
  data.msg.reply("Success!")
})

client.on("ready", () => console.log("Ready"))

client.login(token)

Sending !test or !t should send back Success! with the bot!

You can contribute on the GitHub repository

Slash command support is here with v2!

const { Client, Discord, SlashCommand } = require(".");
const { Intents } = Discord;
const client = new Client({
    intents: [Intents.FLAGS.GUILDS],
    autoListen: true
});

const command = new SlashCommand(client, {
    name: "test",
    options: [{
        name: "test",
        description: "A test",
        type: "STRING"
    }],
    description: "test cmd"
})
client.on("ready", async () => {
  // ONLY RUN THIS ONCE WHEN YOU MODIFY COMMANDS OR YOU WILL LIKELY GET RATELIMITED
    await client.slashCommands.postAll(guildId) // guildId is not required, not passing guildId will make it post to global comands
    console.log("ready")
})

command.on("execute", async ({ interaction }) => {
    await interaction.reply(`This is a reply to the ${interaction.commandName} slash command!`)
})

client.login(token);

Docs?

There are no docs yet, but hopefully this helps:

Client

Regular discord.js with a few changes, including autoListen in ClientOptions and being able to set the prefix. There is also .commands which returns a CommandManager

Args

Args are like js maps, but are readonly. They are mapped by name and user input.

Command and CommandManager

Commands are easy to use and auto listen if set in client options. autoListen in the client options is true by default. CommandManagers help you with managing commands, like listing them, deleting them, etc.

SlashCommand and SlashCommandManager

SlashCommands are almost like Commands, but aren't as flexible as message commands and you can access them on Discord by typing /. SlashCommandManagers hold these commands. Please only run the methods responsibly. Only run them if needed, or you may get ratelimited