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

dblwrapper.js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dblwrapper.js

A package where you can find everything to interact with discord botlists!

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

dblwrapper.js


wrapper for doing anything with all major botlists


npm install dblwrapper.js
yarn add dblwrapper.js
pnpm add dblwrapper.js

Version Total Downloads

Table of Contents

About

Discord Bot List is a comprehensive library that simplifies interacting with major bot lists. It not only allows you to easily post your bot's statistics to multiple Discord bot lists but also provides various other useful functions. With this library, you can check who has voted for your bot, retrieve detailed information about bots and users, and much more. It supports popular bot listing platforms and is designed to be user-friendly.

Please note that while this library aims to support all major bot lists, some lists may not have been thoroughly tested yet.

Supported Bot Lists

IconNameWebsiteClass Name
Top.ggtop.ggTopGG
More will be added soon

Examples

Posting Bot Stats

const { BotList, BotListPoster } = require('dblwrapper.js');

const lists = [
    new BotList.TopGG('you-bot-id', 'your-top.gg-api-token')
];

const poster = new BotListPoster(lists, {
    shardCount: () =>  1,
    guildCount: () => 25,
    userCount: () => 45778,
    voiceConnectionCount: () => 3,
});
// It is adviable to use real values for the above functions

poster.postStatistics(); //Post stats once
poster.startAutoPosting(); //Post stats every 30 minutes
poster.startAutoPosting(5 * 60 * 1000); //Post stats every 5 minutes
poster.stopAutoPoster(); //Stop auto posting

Recieving Webhooks

  • This is a beta feature and is not fully tested yet
  • Webhook URL: https://example.com/receive/<list>/vote

const { BotList, Webhook } = require('dblwrapper.js');

const lists = [
    new BotList.TopGG('you-bot-id', 'your-top.gg-api-token', 'webhook-token') //Webhook URL: https://example.com/receive/topgg/vote
];

const poster = new Webhook(lists, {
port: 3000, // Port to listen on
handleAfterVote: (req, res) => {
    // Do something after a user votes
}, // This isnt required 

});
// If you don't give handleAfterVote function, it will send a 200 response to the webhook and inbuilt events will be emitted
webhook.on(Webhook.Events.Ready, () => {
    // This event is emitted when the webhook is ready
    console.log("Webhook is ready!")
})
webhook.on(Webhook.Events.NewVote, (botList, vote) => {
    // This event is emitted when a new vote is recieved
    console.log(`New vote on ${botList.key} from ${vote.userId}`)
})

Bot List Specific Functions

Top.gg

  • Importing
      const { BotList : TopGG } = require('dblwrapper.js');
    
  • Constructor
        const topgg = new TopGG('bot-id', 'api-token', 'webhook-password');
    
  • Methods
      // Get bot information from Top.gg
      topgg.getBot('bot-id').then(response => {
          console.log(response);
      }).catch(console.error);
      // Get user information from Top.gg
      topgg.getUser('user-id').then(response => {
          console.log(response);
      }).catch(console.error);
      // Check if user has voted for your bot
      topgg.hasVoted().then(response => {
          console.log(response);
      }).catch(console.error);
      /*
      true -> user voted in the last 24 hours
      false -> user didnt vote in the last 24 hours
      */
    

Keywords

FAQs

Package last updated on 09 Jun 2023

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