Skip to content

Instantly share code, notes, and snippets.

@itslukej
Created February 13, 2018 23:36
Show Gist options
  • Save itslukej/4d18750735a67a46ed60891d59a8a822 to your computer and use it in GitHub Desktop.
Save itslukej/4d18750735a67a46ed60891d59a8a822 to your computer and use it in GitHub Desktop.
A script to grab all bots from discordbots.org
const superagent = require('superagent');
const bots = [];
(async () => {
for(let off = 0; off < 100; off++) {
const r = await superagent.get(`https://discordbots.org/api/bots?offset=${off*50}&limit=50`);
// Sort through bots
for(let botScraped of r.body.results) {
const bot = {
discord_id: botScraped.id,
name: botScraped.username,
invite: botScraped.invite,
short_desc: botScraped.shortdesc,
support_invite: botScraped.website.includes('discord.gg') ? botScraped.website : null,
prefix: botScraped.prefix
};
bots.push(bot);
}
}
console.log(JSON.stringify(bots, null, 4));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment