1.1.3 • Published 5 years ago
unofficial-dfapi v1.1.3
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.