Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discord-botlists

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-botlists

Multi-Discord-Botlist Management Package with 40+ Botlist Supported with Events and Stats Update Methods

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

discord-botlists


Discord server npm version npm downloads Tests status

Multi-Discord-Botlist Management Package with 40+ Botlist Supported with Events and Stats Update Methods and More to Add if you want

Installation

Install discord-botlists

$ npm install --save discord-botlists

Documentation

Bot-List Notices

Features

  • Upvote/Vote Events Support 🚗
  • Stats Posting Feature for Discord Bots to Multiple Botlists
  • Better Event Handlers and Request Handlers
  • Better Body Parsing for Incomplete request ( HTTP Post Request )

Scheme :

// Discord Bot Lists Data from the Client Side to the Official package

/**
 * "authorizationToken" -> Example Value -> "EyTYRbGciOiJIUasdIFAnR5cCI6IasApXVCJ9.eyJsaLPOsadadw423zMTQzMTM5NTc0NTk4HJKSIsImJvdCI6dad" -> Very Secret Botlist Token and Bot Specific and unique and need to hide for security
 * "authorizationValue" -> Example Value -> "Discord_Bot_1234OP" -> Self Made jsut to check for vote Webhooks
 **/

var discordBotlistData = {
  bladebotlist: {
    authorizationToken: "xxx-secrettokenhere-xxx",
    authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
  },
  topgg: {
    authorizationToken: "xxx-secrettokenhere-xxx",
    authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
  },
  boatspace: {
    authorizationToken: "xxx-secrettokenhere-xxx",
    authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
  },
  botlistme: {
    authorizationToken: "xxx-secrettokenhere-xxx",
    authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
  },
  botrix: {
    authorizationToken: "xxx-secrettokenhere-xxx",
    authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
  },
  discordlabs: {
    authorizationToken: "xxx-secrettokenhere-xxx",
    authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
  },
  //... "authorizationToken" is something secret and important where you had to "regen" in botlist's webhook page . and its quite long like larger than 25 characters at size
  //... many other botlist data just like above and where "authorizationValue"'s value should be value for "Authorization in HTTP POST request"
};

// Webhook Scheme
var webhookEndpoint = "discord-botlists";
// It will start accepting get and post request to -> "http://localhost:8080/discord-botlists" , where you can change listener port and ip address for pterodactyl users

Point to be Noted :

discordBotlistData Example from : discordBotlistData Structured Data | Where Object-Inner Values get changed with "authorizationToken" and "authorizationValue" Values | Only the name of the main key of the botlist is request like First one was "bladebotlist"

Example Code :

const { BotLists } = require("discord-botlists");

// webhookEndpoint and discordBotlistData is from above scheme
const Botlist = new BotLists(
  "discord-botlists",
  discordBotlistData,
  8080,
  "127.0.0.1"
);

// Starting Botlists Vote Event webhook listening

new Promise(async (resolve) => {
  resolve(
    await Botlist.start(
      "discord-botlists",
      "https://github.com/SidisLiveYT/discord-botlists"
    )
  );
});
// Start Accepting vote Events , even the test votes from every Botlists where your webhook url has been saved in their Webhook manage page

Botlist.on("vote", (websiteName, jsonBody, timestamp) => {
  console.log("Website Name : " + websiteName);
  console.log("Vote Json Data : " + jsonBody);
  console.log("Date/Time : " + timestamp);

  // ... call back function work here ...
});

// Botlists to send Bot Stats to multiple botlist at the same time

new Promise(async (resolve) => {
  resolve(
    await Botlist.poststats(
      {
        bot_id: undefined,
        server_count: undefined,
        shards: undefined,
        shard_id: undefined,
        shard_count: undefined,
      },
      false,
      undefined,
      true,
      true
    )
  );
});
// Above Data should replaced with undefined with appropiate data for post request

// OR Post using AutoPoster on every 2 * 60 * 1000 Milli-Seconds

var Interval_Id = Botlist.autoPoster(
  {
    bot_id: undefined,
    server_count: undefined,
    shards: undefined,
    shard_id: undefined,
    shard_count: undefined,
  },
  undefined,
  10 * 60 * 1000,
  false,
  true
);

// Posted Event for acknowledment of the Data Stats has been Posted successfully
Botlist.on("posted", (formatedResponse, timestamp) => {
  console.log("SuccessRate or Failure Rate : " + formatedResponse);
  console.log("Date/Time : " + timestamp);
  // ... call back function work here ...
});

// Handle Error Event to Ignore Un-Handled Error on Console and avoid Application Crash
Botlist.on("error", (message, extraData, timestamp) => {
  console.log("Error Message : " + message);
  console.log("Related Data with Error : " + extraData);
  console.log("Date/Time : " + timestamp);
  // ... call back function work here ...
});

Keywords

FAQs

Package last updated on 17 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc