Options
All
  • Public
  • Public/Protected
  • All
Menu

Discord.bots.gg API Client for Posting stats or Fetching data

example
const dbots = require(`@beatx/dbots-sdk`)

const api = new dbots.Api('Your discord.bots.gg token')
link

Library docs

link

API Reference

Hierarchy

  • EventEmitter
    • Api

Index

Constructors

constructor

  • new Api(token: string, options?: APIOptions): Api
  • Create Discord.bots.gg API instance

    Parameters

    • token: string

      Token or options

    • options: APIOptions = {}

      API Options

    Returns Api

Methods

getBot

  • getBot(id: string): Promise<BotInfo>
  • Get bot info

    example
    await api.getBot('461521980492087297') // returns bot info
    

    Parameters

    • id: string

      Bot ID

    Returns Promise<BotInfo>

    Info for bot

getBots

  • Get a list of bots

    example
    // Finding by properties
    await api.getBots({
      search: {
        username: 'shiro',
        certifiedBot: true
        ...any other bot object properties
      }
    })
    // =>
    {
      results: [
        {
          id: '461521980492087297',
          username: 'Shiro',
          discriminator: '8764',
          lib: 'discord.js',
          ...rest of bot object
        }
        ...other shiro knockoffs B)
      ],
      limit: 10,
      offset: 0,
      count: 1,
      total: 1
    }
    // Restricting fields
    await api.getBots({
      fields: ['id', 'username']
    })
    // =>
    {
      results: [
        {
          id: '461521980492087297',
          username: 'Shiro'
        },
        {
          id: '493716749342998541',
          username: 'Mimu'
        },
        ...
      ],
      ...
    }
    

    Parameters

    Returns Promise<BotsResponse>

    Return response

getStats

  • getStats(id: string): Promise<BotStats>
  • Get a bots stats

    example
    await api.getStats('461521980492087297')
    // =>
    {
      serverCount: 28199,
      shardCount 1,
      shards: []
    }
    

    Parameters

    • id: string

      Bot ID

    Returns Promise<BotStats>

    Stats of bot requested

postStats

  • Post bot stats to Discord.bots.gg

    example
    await api.postStats({
      serverCount: 28199,
      shardCount: 1,
      shardId: 0,
    })
    

    Parameters

    Returns Promise<BotStats>

    Passed object

Legend

  • Constructor
  • Method
  • Property

Generated using TypeDoc