An API wrapper for topcord.xyz
Usage
Sending Stats
const TCAPI = require('tcapi.js');
const tcapi = new TCAPI('tcapi_token',{}, client);
tcapi.on('success', () => {
console.log('Your bots stats have been posted');
});
tcapi.on('error', (e) => {
console.log(`Error: ${e}`);
});
Receiving Votes
const TCAPI = require('tcapi.js');
const tcapi = new TCAPI('tcapi_token', {port: 5000});
tcapi.webhook.on('listening', (info) => {
console.log(`Listening on port: ${info.port} and on path: ${info.path}`);
});
tcapi.webhook.on('vote', (info) => {
console.log(`${info.userID} voted at ${info.date}`);
});