Giter Site home page Giter Site logo

miniplug

Small plug.dj client for building bots and applications in Node.js, with a Promise-based API.

Installation - Usage - API - Status - Contributing - License: MIT

Installation (install size)

Note: Node v4 or higher is required. Run node -v in your console to check that your Node.js version is up-to-date.

npm install --save miniplug

Usage

const miniplug = require('miniplug')

const mp = miniplug()

// Add an example chat command "!id"
mp.on('chat', (message) => {
  if (/^!id/.test(message.message)) {
    message.reply(`Your user ID is ${message.uid}.`)
  }
})

// Connect to plug.dj
mp.connect({
  email: '[email protected]',
  password: 'hunter2'
}).catch((err) => {
  console.error('Could not connect to plug.dj:')
  console.error(err)
  process.exit(1)
})

// Join a room
mp.join('tastycat').then(() => {
  const room = mp.room()
  mp.chat(`Hello ${room.name}! :wave:`)
})

API

Full API documentation is available in docs/API.md.

For questions, visit the #coding channel in the plug.dj discord!

join the plug.dj discord

Status

Travis npm version David npm downloads

Contributing

Issues/PRs are appreciated!

To build the library, run:

npm run build

The built version will be placed in index.js.

To run tests, do:

npm test

There's not many tests just yet, but it's good to check anyway! This command will also check your code style using Standard.

Changed files will also be tested and linted automatically when you git commit.

License

MIT

miniplug's Projects

miniplug icon miniplug

Small plug.dj client for building bots and applications in Node.js, with a Promise-based API.

plug-login icon plug-login

Log in to plug.dj as a guest or as a registered user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.