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

blapi-logless

v2.0.1

Published

BLAPI is a package to handle posting your discord stats to botlists. It's intended to be used with discord.js, though you can also manually post your stats. This fork removes the Discord is not connected error.

Downloads

22

Readme

BLAPI - the BotListAPI

Codacy Badge npm downloads install size dependencies Status jsDelivr

nodei

BLAPI is a package to handle posting your discord bot stats to botlists. Now typed and ready to be used in your Typescript powered bots!

It's intended to be used with discord.js v12, though you can also manually post your stats.

BLAPI fully supports external and discord.js internal sharding with and without the use of the BotBlock API.

Installation

NPM (recommended)

npm i blapi

Yarn

yarn add blapi

Usage

The list of all supported bot lists and their respective names for the apiKeys object are listed below

Import the lib via ES6 or commonJS modules

// ES6
import * as blapi from "blapi";
// or
import { handle } from "blapi"; // Just the functions you want to use
// or commonJS
const blapi = require("blapi");

With discord.js

import Discord from "discord.js";

const bot = new Discord.Client();

// Post to the APIs every 60 minutes; you can leave out the repeat delay as it defaults to 30
// If the interval is below 3 minutes BLAPI will not use the BotBlock API because of ratelimits
blapi.handle(bot, apiKeys, 60);

Manually, without need of Discord libraries

// If you want to post sharddata you can add the optional parameters
// shardID and shardCount should both be integers
// shardsArray should be an integer array containing the guildcounts of the respective shards
blapi.manualPost(guildCount, botID, apiKeys[, shardID, shardCount[, shardsArray]]);

Turn on extended logging

// Use this to get more detailed logging when posting
// Errors will always be logged
blapi.setLogging(true);

Turn off the use of the BotBlock API

// Use this to turn off BotBlock usage
// By default it is set to true
blapi.setBotblock(false);

apiKeys

The JSON object which includes all the API keys should look like this:

{
  "bot list domain": "API key for that bot list",
  "bot list domain": "API key for that bot list"
}

an example would be:

{
  "bots.ondiscord.xyz": "dsag38_auth_token_fda6gs",
  "discordbots.group": "qos56a_auth_token_gfd8g6"
}

Lists

A list of supported bot lists can be found here. Supported legacy Ids can be found here.

BLAPI will look for new additions on startup via the BotBlock API. This data is being updated internally on a daily basis.

If at any time you find other bot lists have added an API to post your guildcount, let us know on this repo or by contacting T0TProduction#0001 on Discord.

Credit

All the people who helped making BLAPI are listed in AUTHORS

By default we use the BotBlock API to fetch and post.