https://github.com/botblock/botlist
A package for easily updating your server count on all Discord bot lists. [JavaScript - maintained by @PassTheMayo]
https://github.com/botblock/botlist
bot discord list servers
Last synced: 9 months ago
JSON representation
A package for easily updating your server count on all Discord bot lists. [JavaScript - maintained by @PassTheMayo]
- Host: GitHub
- URL: https://github.com/botblock/botlist
- Owner: botblock
- License: mit
- Created: 2019-07-09T02:23:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-28T04:32:09.000Z (over 6 years ago)
- Last Synced: 2025-04-10T20:45:24.362Z (about 1 year ago)
- Topics: bot, discord, list, servers
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/botlist
- Size: 5.86 KB
- Stars: 10
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BotList
A package for easily updating your server count on all Discord bot lists.
## Getting Started
To install the package, you can simply run `npm i botlist` in your bot directory. After the installation is complete, you can append the code below to your bot, which you may need to modify depending on the structure of your bot.
```js
const BotList = require('botlist');
const botID = 'xxx';
const client = new BotList.Client(botID, {
tokens: {
'botlist.space': 'xxx',
'botsfordiscord.com': 'xxx',
'bots.ondiscord.xyz': 'xxx',
'botsparadiscord.xyz': 'xxx',
'carbonitex.net': 'xxx',
'dankbotlist.com': 'xxx',
'discordapps.dev': 'xxx',
'discord.boats': 'xxx',
'discordbots.org': 'xxx',
'discordbotlist.com': 'xxx',
'discordbotreviews.xyz': 'xxx',
'discordbot.world': 'xxx',
'discord.bots.gg': 'xxx',
'discordbotslist.us.to': 'xxx',
'discordbots.group': 'xxx',
'discord.services': 'xxx',
'discordsbestbots.xyz': 'xxx',
'discordbots.fun': 'xxx',
'divinediscordbots.com': 'xxx',
'lbots.org': 'xxx',
'mythicalbots.xyz': 'xxx',
'wonderbotlist.com': 'xxx',
'botlist.co': 'xxx',
'thereisabotforthat.com': 'xxx'
// You can append more tokens here if more bot list websites exist on BotBlock
},
interval: 1000 * 30, // The interval (in milliseconds) to post to every list
verbose: false // Logs posting errors to console
});
client.on('beforePost', () => {
// This event will be fired every interval that is defined in the client constructor. If the client isn't ready yet, you can simply return before calling Client#update(). This will send the previous server/shard count instead.
if (!bot.ready) return;
const serverCount = bot.guilds.size;
const shards = bot.shards.size;
client.update(serverCount, shards); // Instead of `shards` being a number, you can use the following format to post from an individual shard instead (count means server count from this shard): { id: 0, count: 25 }
});
client.on('afterPost', (successful, failed) => {
console.log('Just finished posting to all bot lists, ' + successful + ' were successful, ' + failed + ' failed to post');
});
client.on('error', (error) => {
// There was an error posting to one of the lists, the `error` variable will provide details from the node-fetch package about the error.
console.warn('Something happened', error);
});
// Once the bot is ready, you can call this function to start the interval loop.
client.start();
// If the bot disconnects, you can call this to stop it from running.
client.stop();
```
## Documentation
There is no documentation because the code above is thoroughly documented using comments. If you need any assistance, you can join our *makeshift* support server: [https://discord.gg/GjEWBQE](https://discord.gg/GjEWBQE).