Small plug.dj API client for bots and applications, built on Promises
npm install miniplugSmall [plug.dj][] client for building bots and applications in Node.js, with a Promise-based API.
Installation -
Usage -
[API][docs/API.md] -
Status -
Contributing -
License: MIT
> Note: Node v4 or higher is required.
> Run node -v in your console to check that your Node.js version is up-to-date.
``sh`
npm install --save miniplug
`js
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: 'admin@plug.dj',
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:)`
})
Full API documentation is available in [docs/API.md][].
For questions, visit the #coding channel in the plug.dj discord!




!npm downloads
Issues/PRs are appreciated!
To build the library, run:
`bash`
npm run build
The built version will be placed in index.js.
To run tests, do:
`bash`
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`.

[plug.dj]: https://plug.dj
[docs/API.md]: ./docs/API.md
[Standard]: https://standardjs.com/