A NodeJS API for creating dubtrack.fm bots.
Clone or download
Pull request Compare This branch is 30 commits behind anjanms:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.eslintrc.json
.gitignore
.travis.yml
CHANGELOG.md
LICENSE.md
README.md
index.js
package.json

README.md

DubAPI

About

A NodeJS API for creating dubtrack.fm bots.

Usage

npm install dubapi
var DubAPI = require('dubapi');

new DubAPI({username: '', password: ''}, function(err, bot) {
    if (err) return console.error(err);

    console.log('Running DubAPI v' + bot.version);

    function connect() {bot.connect('friendship-is-magic');}

    bot.on('connected', function(name) {
        console.log('Connected to ' + name);
    });

    bot.on('disconnected', function(name) {
        console.log('Disconnected from ' + name);

        setTimeout(connect, 15000);
    });

    bot.on('error', function(err) {
        console.error(err);
    });

    bot.on(bot.events.chatMessage, function(data) {
        console.log(data.user.username + ': ' + data.message);
    });

    connect();
});

Credit