1.0.1 • Published 5 years ago
listmybots v1.0.1
List My Bots API
Easily use the listmybots.com API from your NodeJS bots!
Examples
// Create the client
const { Client } = require('listmybots-api');
const listmybots = new Client('api key');
// Get stats about the list
await listmybots.stats(); // Returns an object of stats
// Get information about the current bot user
await listmybots.me(); // Returns an object of information about the current bot
// Get information about a specific bot
await listmybots.botInfo('bot id'); // Returns general information about the requested bot
// Gets if a user has liked the bot on listmybots.com
await listmybots.botLiked('user id'); // Returns the timestamp of when they voted if they have, otherwise false
// Post servers to listmybots.com
await listmybots.postServers(100); // Returns true if it posts successfully
// Get information about a specific user
await listmybots.userInfo('user id'); // Returns an object of user information
Webhook
const { Webhook } = require('dboats-api');
const webhookServer = new Webhook({
port: 1234, // required
auth: 'password in listmybots.com', // required
path: '/webhook' // optional path for the webhook, defaults to /
});
webhookServer.on('like', (botId, userId) => { }); // create an event to handle when your bot is liked
webhookServer.on('unlike', (botId, userId) => { }); // create an event to handle when your bot is unliked
webhookServer.start(); // start the server