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

nextgenapi.js

v2.0.3

Published

The Official NPM Module for interacting with the Next Gen Bots API

Downloads

3

Readme

Next Gen Bot List API Wrapper

The official NPM Module for interacting with the Next Gen Bots API


Support


Documentation


Installation

npm i nextgenapi.js@latest

or

npm i [email protected]

or

npm i nextgenapi.js --save


Hard Coded Install

Append the Line below to your package.json

    "nextgenapi.js": "^2.0.3",

• Save and profit


Posting Stats

Constructor

NextGen(client, token)
Arguments

Parameter | Type | Optional | Description |--------------|----------|--------------|--------------| token | String | No | The API Auth Token found on your bots page. client | Snowflake | No | The Client ID for the bot you want to post stats to.


Discord.js v12 Example

const Discord = require("discord.js")
const client = new Discord.Client()
const prefix = "!";
const NextGen = require("nextgenapi.js")
const ngbl = new NextGen(client.user.id,"bot-auth-token")

client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}.`)
setInterval(() => {
   ngbl.postStats(client.guilds.cache.size)
  })
}, 300000) // 5 Minutes in MS

client.on("message", message => {
    if(message.author.bot) return
    if(message.content == prefix + "ping"){
        message.reply(`Pong! it took ${client.ws.ping}`)
    }
})

client.login("token")

Getting Stats

Constructor

NextGen()
Arguments

Parameter | Type | Optional | Description |--------------|----------|--------------|--------------| daily_votes | Number | Yes | Fetch the Daily Votes for the Bot. short_desc | Snowflake | Yes | Fetch the Short Description for the Bot. prefix | String | Yes | The Bots Prefix. ownerID | Snowflake | Yes | The Bot Owners ID tags | String | Yes | List of the Bots Tags on our Website. support | String | Yes | The Bots assigned Support Link Token (NOTE: This only returns the Invite Token you have to add the link Example: https://discord.gg/${7v4fNuF5Bm}) total_votes | Number | The Bots total Vote Count. guilds | Number | Total Number of Guilds the Bot is in (If posting stats)


Example

const Discord = require("discord.js")
const client = new Discord.Client()
const prefix = "!";
const NextGen = require("nextgenapi.js")
const stats = new NextGen()
 
client.on("ready", () => { // ready listenerconsole.log(`Logged in as ${client.user.tag}`)}) 
client.on("message", message => { // message listener
    if(message.author.bot) return;
    if(message.channel.type !== "text") return;
    if(!message.content.toLowerCase().startsWith(prefix)) return;
    if(message.content == (prefix + "ping")){
        message.reply(`Pong ${client.ws.ping}ms`)
    }
     if(message.content == (prefix + "stats")){
        stats.get(client.user.id, function(data){
        let embed = new MessageEmbed()
        .addField("Total Votes", data.total_votes);

        message.channel.send(embed)
        })
    }
})
 
 
client.login("token")