Skip to main content
Module

x/dblapi/mod.ts>DBL

Wrapper for DBL API (top.gg) for Deno.
Latest
class DBL
import { DBL } from "https://deno.land/x/dblapi@0.0.1/mod.ts";

Constructors

new
DBL(options: DBLOptions)

Properties

optional
id: string

Your Bot's ID

optional
secret: string

Secret if you have set any to arrive with Webhook Payloads

token: string

API token for DBL

Methods

getBot(id?: string): Promise<BotInfo>

Get a bot's info. Defaults to given ID in options if any.

getBots(query: QueryOptions): Promise<AnyObj>

Search for bots using query.

getStats(id?: string): Promise<BotStats>

Get a bot's stats. Defaults to given ID in options if any.

getUser(id: string): Promise<User>

Get a User's info.

getVotes(): Promise<User[]>

Get votes of the bot. Last 1,000 only. Use Webhooks for bots with more than 1k monthly votes.

hasVoted(id: string): Promise<boolean>

Check whether a user has voted.

isWeekend(): Promise<boolean>

Whether it is weekend or not.

postStats(
serverCount: number,
shardID?: number,
shardCount?: number,
): Promise<void>

Post your bot's stats to DBL API.

prepare(method: HTTPRequestMethod, body?: any)

Prepare Request Options

request(
url: string,
body?: AnyObj,
)

Make a Request to DBL API