Socket
Socket
Sign inDemoInstall

bfd-api-redux

Package Overview
Dependencies
2
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bfd-api-redux

A node.js wrapper for the Bots For Discord API


Version published
Maintainers
1
Install size
88.8 kB
Created

Readme

Source

NOTICE & INFO

bfd-api-redux is an official bot-page API wrapper for Discords.com (formerly botsfordiscord.com). Please direct all inqueries and support requests to our support server.

Usage

Constructing a new API interface:

var bfd = require('bfd-api-redux');
var api = new bfd('BFD_Token', 'botID');

NOTE: If you do now wish to use callbacks, then all actions must be used inside async functions with an await, for example:

async function user() {
    console.log(await api.getUser('254287885585350666'));
}
user();

You can easily update your Bot's guild count using this function:

let serverCount = client.guilds.cache.size; 
api.setServers(serverCount)

Examples

Get votes

api.getVotes12().then(votes => {
    console.log(votes)
})

Get user

api.getUser("254287885585350666").then(user => { //Provide a user id
    console.log(user)
})

Get user bots

api.getUserBots("254287885585350666").then(bots => { //Provide a user id
    console.log(bots)
})

Get bot

api.getUser("621352902656524288").then(bot => { //Provide a bot id
    console.log(bot)
})

Get widget

api.getWidget("621352902656524288").then(widget => { //Provide a bot id
    console.log(widget)
})

Cheking a vote for one specific user (including structure)

api.checkVote("254287885585350666").then(vote => { //Provide a user id
    console.log(vote) //true or false + vote structure
})

Cheking a vote for one specific user (lightweight structure)

api.checkVoteLight("254287885585350666").then(vote => { //Provide a user id
    console.log(vote) //true or false
})

Keywords

FAQs

Last updated on 07 Mar 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc