UNPKG

blapi

Version:

BLAPI is a package to handle posting your discord stats to botlists. It's intended to be used with discord.js, though you can also manually post your stats.

55 lines (54 loc) 2.24 kB
import { Response } from 'centra'; import type { Client } from 'discord.js'; import { UserLogger } from './requests'; type apiKeysObject = { [listname: string]: string; }; export declare enum LogLevel { None = 0, ErrorOnly = 16, WarnAndErrorOnly = 32, All = 48 } type LogOptions = { /** * @deprecated Use logLevel instead. * * If you want an equivalent to `extended: true`, use `logLevel: LogLevel.All` */ extended?: boolean; /** * The log level to use * @default LogLevel.WarnAndErrorOnly */ logLevel?: LogLevel; /** * Your custom logger to be used instead of the default console logger */ logger?: UserLogger; }; /** * This function is for automated use with discord.js * @param discordClient Client via wich your code is connected to Discord * @param apiKeys A JSON object formatted like: {"botlist name":"API Keys for that list", etc.} * @param repeatInterval Number of minutes until you want to post again, leave out to use 30 */ export declare function handle(discordClient: Client, apiKeys: apiKeysObject, repeatInterval?: number): Promise<void>; /** * For when you don't use discord.js or just want to post to manual times * @param guildCount Integer value of guilds your bot is serving * @param botId Snowflake of the ID the user your bot is using * @param apiKeys A JSON object formatted like: {"botlist name":"API Keys for that list", etc.} * @param shardId (optional) The shard ID, which will be used to identify the * shards valid for posting * (and for super efficient posting with BLAPIs own distributer when not using botBlock) * @param shardCount (optional) The number of shards the bot has, which is posted to the lists * @param shards (optional) An array of guild counts of each single shard * (this should be a complete list, and only a single shard will post it) */ export declare function manualPost(guildCount: number, botID: string, apiKeys: apiKeysObject, shard_id?: number, shard_count?: number, shards?: Array<number>): Promise<Array<Response | { error: any; }>>; export declare function setLogging(logOptions: LogOptions): void; export declare function setBotblock(useBotblock: boolean): void; export {};