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

Comparing version 1.2.0 to 1.2.1

2

package.json
{
"name": "bfd-api-redux",
"version": "1.2.0",
"version": "1.2.1",
"description": "A node.js wrapper for the Bots For Discord API",

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

@@ -37,3 +37,3 @@ ## NOTICE & INFO

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

@@ -45,3 +45,3 @@ })

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

@@ -53,3 +53,3 @@ })

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

@@ -61,3 +61,3 @@ })

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

@@ -67,2 +67,16 @@ })

### Cheking a vote for one specific user (including structure)
```js
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)
```js
api.checkVoteLight("254287885585350666").then(vote => { //Provide a user id
console.log(vote) //true or false
})
```

@@ -73,2 +73,30 @@ const EventEmitter = require("events");

async checkVoteLight(userid) {
return new Promise(async (resolve, reject) => {
const votes = await this.getVotes12();
if (Array.isArray(votes.entries)) {
resolve(votes.entries.some(vote => vote.userid === userid))
} else {
resolve(false);
}
})
}
async checkVote(userid) {
return new Promise(async (resolve, reject) => {
const votes = await this.getVotes12();
if (Array.isArray(votes.entries)) {
let structure = { voted: true, votes: []};
votes.entries.forEach(vote => {
if (vote.userid === userid) {
structure.votes.push(vote)
}
})
resolve(structure)
} else {
resolve(false);
}
})
}
async getWidget(id) {

@@ -75,0 +103,0 @@ return new Promise((resolve, reject) => {

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