npm.io
1.1.3 • Published 7 years ago

unofficial-dfapi

Licence
MIT
Version
1.1.3
Deps
1
Size
3 kB
Vulns
1
Weekly
0
DeprecatedThis package is deprecated

unofficial-dfapi

The wrapper for the unofficial DiamondFire API

Docs

These docs are actually just examples, because I'm too lazy to write actual documentation. Cheers!

Initialization

const DF = require("unofficial-dfapi");
const client = new DF("your API key here");
Running commands
// code from above
client.request({
command: "dfapi_run",
plot: 666
}).then(response => {
    console.log(response); // dab
}).catch(err => {
    console.error(err); // Invalid Authorization header
                        // The API key is incorrect.
});
Events
// code from above
client.on("queued", data => {
   console.log(data); // https://diamondfire.glitch.me/send-message?command=dfapi_run&plot=666
});
client.on("response", res => {
   console.log(res.statusCode); // 200 
});

If you need more help, join the DFAPI Discord server.

Keywords