mblapi.js

This is the official api of My Bot List (I think)

Usage no npm install needed!

<script type="module">
  import mblapiJs from 'https://cdn.skypack.dev/mblapi.js';
</script>

README

MblApi.js

This is the official api of My Bot List (I think)

Installation

npm i mblapi.js --save

Exemples

Posting the number of servers in the discord.js library

const Discord = require('discord.js')
const client = new Discord.Client()
const mbl = require('mblapi.js')
const MblClient = new mbl('YOUR TOKEN', client)

MblClient.on('posted', () => {
  console.log('Server count has been posted')
})

Getting a bot with id

const Discord = require('discord.js')
const client = new Discord.Client()
const mbl = require('mblapi.js')
const MblClient = new mbl('YOUR TOKEN', client)

MblClient.getBot('470684281102925844')
//Returns
/*{ id: '470684281102925844',
  guilds: 38,
  desc: 'An awesome Bot with awesome commands',
  markdown:
   '#   Bot top\n\n<img src="https://i.imgur.com/r2sGfIk.jpg" alt="cat" title="image">',
  favorites: 5,
  lib: 'Discord.js',
  rating:
   { rating: 85.23076923076923,
     comments: [...] },
  owner: '365948625676795904',
  visits: 107,
  views: [...],
  prefix: 'j!',
  server: '',
  tags: [...],
  github: 'https://github.com/Acnologla',
  site: 'http://asura-site.glitch.me/',
  background: 'https://i.imgur.com/r2sGfIk.jpg' }
*/

Getting the people who marked the bot a favorite

const Discord = require('discord.js')
const client = new Discord.Client()
const mbl = require('mblapi.js')
const MblClient = new mbl('YOUR TOKEN', client)

MblClient.getFavorites()
//returns array with the id of people as liked

// ['28934893280480985']