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

dblapi.js

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dblapi.js - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

1

.eslintrc.json

@@ -105,3 +105,2 @@ {

"max-depth": "error",
"max-len": ["error", 120, 2],
"max-nested-callbacks": ["error", { "max": 4 }],

@@ -108,0 +107,0 @@ "max-statements-per-line": ["error", { "max": 2 }],

4

index.js

@@ -15,5 +15,5 @@ const snekfetch = require('snekfetch');

client.on('ready', () => {
this.postStats();
this.postStats().catch(e => console.error(`[dblapi.js autopost] Failed to post stats: ${e.text}`)); // eslint-disable-line no-console
setInterval(() => {
this.postStats();
this.postStats().catch(e => console.error(`[dblapi.js autopost] Failed to post stats: ${e.text}`)); // eslint-disable-line no-console
}, 1800000);

@@ -20,0 +20,0 @@ });

{
"name": "dblapi.js",
"version": "1.2.0",
"version": "1.2.1",
"description": "An official module for interacting with the discordbots.org API",

@@ -21,3 +21,4 @@ "main": "index.js",

"snekfetch": "^3.6.4"
}
},
"typings": "./typings/index.d.ts"
}

@@ -1,19 +0,21 @@

declare module "dblapi.js" {
export class DBLAPI {
constructor(token: string, client?: any)
public postStats(serverCount: number, shardId?: number, shardCount?: number): Promise<Buffer>
public getStats(id: string): Promise<BotStats>
public getBot(id: string): Promise<Bot>
public getUser(id: string): Promise<User>
public getBots(query: BotsQuery): Promise<BotSearchResult>
public getVotes(onlyids?: boolean, days?: number): Promise<Votes[]>
public hasVoted(id: string): Promise<boolean>
export = DBLAPI;
public token?: string;
private _request(method: string, endpoint: string, data?: Object, auth?: boolean): Promise<Object>
}
declare class DBLAPI {
constructor(token: string, client?: any)
type BotStats = {
public postStats(serverCount: number, shardId?: number, shardCount?: number): Promise<Buffer>
public getStats(id: string): Promise<DBLAPI.BotStats>
public getBot(id: string): Promise<DBLAPI.Bot>
public getUser(id: string): Promise<DBLAPI.User>
public getBots(query: DBLAPI.BotsQuery): Promise<DBLAPI.BotSearchResult>
public getVotes(onlyids?: boolean, days?: number): Promise<DBLAPI.Votes[]>
public hasVoted(id: string): Promise<boolean>
public token?: string;
private _request(method: string, endpoint: string, data?: Object, auth?: boolean): Promise<Object>
}
declare namespace DBLAPI {
export type BotStats = {
server_count: number;

@@ -23,4 +25,4 @@ shards: number[];

}
type Bot = {
export type Bot = {
id: number;

@@ -46,4 +48,4 @@ username: string;

}
type User = {
export type User = {
id: number;

@@ -64,4 +66,4 @@ username: string;

}
type UserSocial = {
export type UserSocial = {
youtube?: string;

@@ -73,4 +75,4 @@ reddit?: string;

}
type BotsQuery ={
export type BotsQuery ={
limit?: number;

@@ -82,4 +84,4 @@ offset?: number;

}
type BotSearchResult = {
export type BotSearchResult = {
results: Bot[];

@@ -91,4 +93,4 @@ limit: number;

}
type Votes = {
export type Votes = {
username: string;

@@ -95,0 +97,0 @@ discriminator: string;

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