discord-botlists.

discord-botlists docs · archived reader

Getting Started

Setup and tokens

Constructing Botlists and providing tokens.

the usual setup

import { Client } from 'discord.js';
import { Botlists } from '@potenfyrstudios/discord-botlists';

const client = new Client({ intents: ['Guilds'] });

const lists = new Botlists({
  client,                       // optional: discord.js or Eris client
  tokens: {
    'top.gg': process.env.TOPGG_TOKEN,
    'discordbotlist.com': process.env.DBL_TOKEN,
  },
  webhook: {
    port: 8080,                 // default 8080
    path: '/discord-botlists',  // default
    secret: process.env.WEBHOOK_SECRET,
  },
  startupStatusCheck: true,     // print the status table on first postStats
});

Token resolution order

  • Environment variables: DBL_<LIST-ID-UPPERCASED>, for example DBL_TOP.GG.
  • The tokens map in the constructor overrides env per list id.
  • Lists without a token are skipped by postStats and reported as skipped, never as failures.
OptionTypeDefaultDescription
botIdstringclient.user.idYour bot application id
clientBotClientLikenulldiscord.js, Eris or Oceanic client for auto stats
statsProviderStatsProvidernullProvide stats yourself: any framework or none
tokensRecord<string,string>env DBL_*Per list tokens, overrides env
authHeadersRecord<string,string>per list defaultOverride the auth header name per list
listsBotlistRecord[][]Add custom or self-hosted lists
webhookWebhookOptions{}Webhook server config
fetchOptionsFetchOptionstimeout 10s, 2 retriesApplied to every request
disableStatusCheckbooleanfalseSkip pre-request status lookups
startupStatusCheckbooleanfalseProbe and print the status table on first post