tcapi.js

3.0.0 • Public • Published

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

Package Sidebar

Install

npm i tcapi.js

Weekly Downloads

6

Version

3.0.0

License

MIT

Unpacked Size

16.5 kB

Total Files

5

Last publish

Collaborators

  • misly