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

new-dblapi

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

new-dblapi - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

36

dblapi.js

@@ -7,3 +7,3 @@ const http = require('http')

class DblAPI extends EventEmitter{
/*
/**
* Creates a new instance.

@@ -18,3 +18,3 @@ * @param {string} token A discordbots.org token.

* @param {string} [options.voteEmbed.url] A discord guild webhook url.
* @param {Array > Object} [options.voteEmbed.fields] An array of objects to use as fields in the embed. Must contain a 'name' key and a 'value' key. {user} will be replaced with the voters username and {id} will be replace with the voters id.
* @param {Array [Object]} [options.voteEmbed.fields] An array of objects to use as fields in the embed. Must contain a 'name' key and a 'value' key. {user} will be replaced with the voters username and {id} will be replace with the voters id.
* @param {string} [options.voteEmbed.title = 'New Vote'] A string to use as the title. Defaults to 'New Vote'.

@@ -80,3 +80,3 @@ * @param {string} [options.voteEmbed.color = Random] A hex string to use as the color. Defaults to a random color.

/*
/**
* Sets the vote embed webhook.

@@ -94,3 +94,3 @@ * @param {Object} voteEmbed The voteEmbed object.

/*
/**
* Create a request.

@@ -125,6 +125,6 @@ * @param {Object} opts Options, does not POST.

/*
/**
* Gets a user from the discordbots.org api.
* @param {string} id A user id.
* @returns {Promise<User>}
* @returns {Promise<Object>}
*/

@@ -145,7 +145,7 @@ async getUser(id){

/*
/**
* Gets a bot from the discordbots.org api.
* @param {string} [id = this.client.user.id] A bot id, defaults to the current clients id.
* @param {boolean} [votes = false] A boolean to return last 1000 votes or a bot.
* @returns {Promise<Bot>} OR {Promise<Array>}
* @returns {Promise<Object>} OR {Promise<Array>}
*/

@@ -171,6 +171,6 @@ async getBot(id, votes = false){

/*
/**
* Check if a user has voted.
* @param {string} id A user id.
* @returns {Promise<number>}
* @returns {Promise<boolean>}
*/

@@ -190,6 +190,6 @@ async checkVote(id){

let req = await this.request(opts)
return await JSON.parse(req).voted
return await !!(JSON.parse(req).voted)
}
/*
/**
* Get a bots stats.

@@ -214,3 +214,3 @@ * @param {string} [id] A bots id.

/*
/**
* Gets a bots widget.

@@ -244,3 +244,3 @@ * @param {string} [id = this.client.user.id] A bots id defaulting to this.client.user.id.

/*
/**
* Sends an embed with the webhook.

@@ -255,3 +255,3 @@ * @param {Object} The content to send.

/*
/**
* Triggered on vote.

@@ -308,3 +308,3 @@ * @param {Object} req The request.

/*
/**
* Posts the bots stats to discordbots.org.

@@ -371,3 +371,3 @@ */

/*
/**
* Ensures the client is discord.js

@@ -386,2 +386,2 @@ * @returns {boolean}

module.exports = DblAPI
module.exports = DblAPI
{
"name": "new-dblapi",
"version": "1.1.2",
"version": "1.1.3",
"description": "A new dbl api.",

@@ -5,0 +5,0 @@ "main": "dblapi.js",

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