Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/akrasio/disforge.js

An api wrapper for disforge.com
https://github.com/akrasio/disforge.js

Last synced: 2 months ago
JSON representation

An api wrapper for disforge.com

Awesome Lists containing this project

README

        

## Installation
```bash
npm i disforge.js
```

## how to use

```js
const Discord = require("discord.js");
const client = new Discord.Client();
const Disforge = require('disforge.js');
const api = new Disforge.Client("Your-Disforge-API-Key-Here");

// Posting manually...
api.postStats(client).then(result => {
console.log(result)
});

// Posting every hour automatically :sunglasso:
api.autoPost(client).then(result => {
console.log(result)
});

client.login("YourDiscordBotTokenIsHere");

// You can replace "servers_total_members" with one of the strings below for a specific option OR not provide a value to return an object of all data.
/*
"servers_total_members", "servers", "servers_total_members", "bots", "bots_total_servers", "bots_awaiting_approval", "registered_users", "last_updated"
*/
api.stats("servers_total_members").then(result => {
console.log(result)
});
// 10m RateLimit on checking votes
client.on("messageCreate", async (msg) => {
if (msg.author.bot) return;
if (msg.content.toLowerCase() == ";voted") {
api.checkVote(client).then(res => {
console.log(res)
msg.reply(`${res}`)
})
}
})
```

-> [disforge.com](https://disforge.com)

-> [disforge.js](https://npmjs.org/disforge.js)