Botlister is an easy to use, zero-dependency NodeJS library for the discordbotlist.com
const botlister = new (require('botlister'))({ apiToken: 'abcdef', defaultBotId: '371840836423385101' })
botlister.updateBotStatistics({
guilds: bot.guilds.size,
users: bot.users.size,
}).catch(console.error);
// OR
const dblBot = await botlister.fetchBot('1111');
console.log(dblBot.statistics);
dblBot.updateStatistics({ guilds: 1 });
// read docs for more coolnessNeed an example? Check out the example folder
Go to your bots page and select one of your bots, then click generate token
- Core
- Parameters
- fetchPopularBots
- fetchAllBots
- searchBots
- fetchMyBots
- fetchBot
- fetchUpvoters
- generateBotToken
- updateBotStatistics
- resetBotStatistics
- deleteBot
- upvoteBot
- updateBotInformation
- addBot
- fetchUser
- banUser
- unbanUser
- refreshUser
- fetchUninvitedBots
- verifyBot
- unverifyBot
- refreshBot
- fetchConfiguration
- lockDatabase
- unlockDatabase
- Bot
- User
Represents main library
optionsObject? Botlister options (all options are optional)
Fetch an array of "hot" or "popular" bots
Returns Promise<Array<Bot>> Resolves with an array of Bot objects
Fetch an array of all bots on the website. Use lightly.
skipNumber Amount of bots to skip (optional, default0)
Returns Promise<Array<Bot>> Resolves with an array of Bot objects
Search through all bots with a search term.
searchTermString? The search term to use (optional, default'')
Returns Promise<Array<Bot>> Resolves with an array of Bot objects
Fetch the current user's bots. Requires a userToken.
skipNumber Amount of bots to skip (optional, default0)
Returns Promise<Array<Bot>> Resolves with an array of Bot objects
Fetch a bot
idString? The ID of the bot to fetch, defaults to the defaultBotId (if one is set) (optional, defaultthis.defaultBotId)
Returns Promise<Bot> Resolves with a Bot object
Fetch an array of users who upvoted the bot
idString? The ID of the bot to fetch upvoters for, defaults to the defaultBotId (if one is set) (optional, defaultthis.defaultBotId)
Returns Promise<Array<User>> Resolves with an array of User objects
Re-generates the bot API token. Requires a userToken.
idString? The ID of the bot, defaults to the defaultBotId (if one is set) (optional, defaultthis.defaultBotId)
Returns Promise<String> Resolves with a new apiToken
Updates bot statistics. Requires an apiToken.
idString? The ID of the bot, defaults to the defaultBotId (if one is set) (optional, defaultthis.defaultBotId)statisticsObject Statistics to send
Returns Promise
Resets bot statistics. Requires an apiToken.
idString? The ID of the bot, defaults to the defaultBotId (if one is set) (optional, defaultthis.defaultBotId)
Returns Promise
Deletes the bot. Requires a userToken.
idString? The ID of the bot, defaults to the defaultBotId (if one is set) (optional, defaultthis.defaultBotId)
Returns Promise
Upvotes the bot with the user's account. Requires a userToken.
idString? The ID of the bot, defaults to the defaultBotId (if one is set) (optional, defaultthis.defaultBotId)
Returns Promise
Updates/edits the bot information on the website. Requires a userToken.
idString? The ID of the bot, defaults to the defaultBotId (if one is set) (optional, defaultthis.defaultBotId)infoObject Updated bot information
Returns Promise
Submits a new bot to the website. Requires a userToken.
infoObject Bot informationinfo.idString The ID of the bot, defaults to the defaultBotId (if one is set)info.shortDescriptionString Short descriptioninfo.longDescriptionString? Long descriptioninfo.prefixString Bot prefixinfo.websiteString? Bot websiteinfo.botInviteString Bot inviteinfo.serverInviteString? Server invite
Returns Promise
Fetch a user
idString The ID of the user
Ban a user. Requires a userToken. Requires admin.
idString The ID of the user
Returns Promise
Unban a user. Requires a userToken. Requires admin.
idString The ID of the user
Returns Promise
Refresh a user. Requires a userToken. Requires admin.
idString The ID of the user
Returns Promise
Fetch an array of bots that are not in the DBL server. Requires a userToken. Requires admin.
Returns Promise<Array<Bot>> Resolves with an array of Bot objects
Verify a bot. Requires a userToken. Requires admin.
idString The ID of the bot
Returns Promise
Unverify a bot. Requires a userToken. Requires admin.
idString The ID of the user
Returns Promise
Refresh a bot. Requires a userToken. Requires admin.
idString The ID of the user
Returns Promise
Fetch DBL configuration. Requires a userToken. Requires admin.
Returns Promise<Object> {"db_locked": true}
Lock database. Requires a userToken. Requires admin.
Returns Promise
Unlock database. Requires a userToken. Requires admin.
Returns Promise
Represents a DBL bot
datacore
idString The ID of the botcreatedAtTimestamp Timestamp of when the bot was added to DBLlastUpdatedAtTimestamp Timestamp of when the bot was last updatedavatarString? The hash of the bot's avatar, or null if no avatardefaultAvatarURLString The URL of the bot's default avataravatarURLString The URL of the bot's avatarusernameString The username of the botdiscriminatorString The discriminator of the botshortDescriptionString The short description of the botlongDescriptionString The long description of the botprefixString The bot prefixwebsiteString The bot websitebotInviteString The invite to the botserverInviteString Server inviteverifiedBoolean Whether the bot is verified or notupvotesNumber Number of upvotes the bot hasupvotedBoolean Whether the bot has been upvoted or notownerUser The user object of the bot ownerstatisticsObject? The bot statistics
Get an array of users who have upvoted the bot
Returns Promise<Array<User>> Resolves with an array of User objects
Regenerate the bot token. Requires a userToken.
Returns Promise<String> Resolves with the new bot token
Updates bot statistics. Requires an apiToken.
statisticsObject Statistics to sendidString? The ID of the bot, defaults to the defaultBotId (if one is set)
Returns Promise
Resets bot statistics
Returns Promise
Deletes bot. Requires a userToken.
Returns Promise
Upvotes bot. Requires a userToken.
Returns Promise
Updates/edits the bot information on the website. Requires a userToken.
infoObject Updated bot informationidString? The ID of the bot, defaults to the defaultBotId (if one is set)
Returns Promise
Verifies bot. Requires a userToken.
Returns Promise
Unverifies bot. Requires a userToken.
Returns Promise
Refresh bot. Requires a userToken.
Returns Promise
Represents a DBL user
datacore
idString The ID of the usercreatedAtTimestamp Timestamp of when the user was added to DBLavatarString? The hash of the user's avatar, or null if no avatardefaultAvatarURLString The URL of the user's default avataravatarURLString The URL of the user's avatarusernameString The username of the userdiscriminatorString The discriminator of the useradminBoolean Whether the user is an administrator or notbannedBoolean Whether the user is banned or notbotsArray<Bot> Array of Bot objects that belong to the user
Ban user. Requires userToken.
Returns Promise
Unban user. Requires userToken.
Returns Promise
Refresh user. Requires userToken.
Returns Promise
Maintained by Wright
Contact me on Discord wright#0666