Giter VIP home page Giter VIP logo

listcord.js's Introduction

Listcord.js

An official wrapper for listcord api! As this library lacks in documentation kindly make an issue or contact us on discord for doubts!

View https://listcord.xyz/apidocs to view the raw api documentation!

Installation

npm i listcord.js

Getting started

Get your api token from https://listcord.xyz/me. Listcord api is currently only available only for those who has bots registered in our botlist! After getting your token, make sure you save it in .env file!

const Listcord = require('listcord.js');
const client = new Listcord.Client(process.env.LISTCORD_API_TOKEN);

client.getBot('some bot id').then(x => console.log(x));

Methods

Basic methods of listcord api!

await client.getBot('801976787264471120'); // Returns you the information of the bot!
await client.getBotReviews('801976787264471120'); // Returns you array of reviews of the bot!
await client.getReview('user id', 'bot id'); // Returns the review details by the discord id of the reviewer and the bot which was reviewed!
await client.getPack('featuredfun'); // Returns the bot packs information which has id 'featuredfun'
await client.getPacks(); // Returns all packs in a object refer Listcord.APITypes.Botpacks for types!
await client.hasVoted('user id', 'bot id'); // Verify if particular user has voted a paticular bot by id!

Post stats

You can either post stats using Listcord.AutoPoster or either Listcord.Client.prototype.postStats!

const { success, message } = await client.postStats('801976787264471120', 100 /** Server count. */ );
console.log(success ? 'Success' : `Failed: ${message}`);

AutoPoster

Autoposter supports eris and discord.js libraries!

const poster = client.createAutoPoster(client, /** Discord client */ {
    interval: 900000, // Default
    startOnInitiate: true // Default
})

poster.on('post', (response) => console.log(response)); // Emits when on successful post
poster.on('error', (error) => console.log(error)); // Emits on error!

poster.stop(); // Stops posting...
poster.start(); // Starts posting...

Events

There are some events of the client such as serverError, rateLimit, invalidToken, error!

client.on('serverError', () => console.log('Looks like the server has got some error! 500!')); // Event fires when our server gets an error and we could not send you the response!
client.on('rateLimit', () => console.log('Looks like we have sent so much requests! So its 429!')); // Event fires when you have been rate limited by our api!
client.on('invalidToken', () => console.log('Looks like your token you have sent to the listcord api is invalid! 40!')); // This happens when your token is been invalid and you are making requests to the api!
client.on('error', console.log); // Event fires when an unknown error occurs!

Contact

listcord.js's People

Contributors

scientific-dev avatar

Watchers

 avatar

Forkers

euandrelucas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.