Skip to content

WritheM/plugged

Folders and files

NameName
Last commit message
Last commit date
May 26, 2015
May 25, 2015
May 25, 2015
Apr 20, 2015
May 25, 2015
May 25, 2015
May 27, 2015
May 27, 2015
May 26, 2015
May 25, 2015

Repository files navigation

plugged

plugged is a (v|f)ast JavaScript API for the plug.dj service.

Installation

npm install plugged

How to use

plugged is relatively easy to use. Most functions are exposed via events, thus it's easy to check for certain data.

To start with a simple bot, do this:

var Plugged = require("plugged");
var plug = new Plugged();

// log into the service
plug.login({ email: "[email protected]", password: "examplepassword" });

plug.on(plug.LOGIN_SUCCESS, function _loginSuccess() {
    plug.cacheChat(true);
    plug.connect("exampleroom");
});

plug.on(plug.JOINED_ROOM, function _joinedRoom() {
    plug.on(plug.ADVANCE, function() {
        //WOOT!
        plug.woot();
    });
});

Events

Most functionality is exposed via Events. The wiki describes how to use what events when.

Server calls

Sometimes you need to call data from the server, for example if you want to get your current playlist, add a new media file or get a certain list of rooms based on a search string. All Server calls are described in the wiki

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%