fatesapi.js
v1.0.3
Published
Main NPM Wrapper for the Fates List API
Downloads
7
Readme
Fates List NPM Wrapper
The official NPM Module for interacting with the Fates List API
Installation
npm i @fates/npm@latest
or
npm i @fates/[email protected]
or
npm i @fates/npm --save
POST Stats
Constructor
FatesClient(client, token)
Arguments
Parameter | Type | Optional | Description |--------------|----------|--------------|--------------| token | String | No | The API Auth Token found on your bots page. client | Snowflake | No | The Client ID for the bot you want to post stats to.
Discord.js v12 Example
const Discord = require("discord.js")
const client = new Discord.Client()
const prefix = "test.";
const Fates = require("@fates/npm")
const poster = new Fates(client.user.id, "bot-auth-token")
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}.`)
setInterval(() => {
poster.post(client.guilds.cache.size, {
"servers": client.guilds.cache.size,
"shard_count": 0
"users" client.users.cache.size
})
})
}, 300000) //5 Minutes in MS
client.on("message", message => {
if(message.author.bot) return
if(message.content == prefix + "ping"){
message.reply(`Pong! it took ${client.ws.ping}`)
}
})
client.login("token")