Skip to content

Misly16/TCAPI.JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TCAPI.JS

An API wrapper for topcord.xyz

npm

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}`);
});