1.0.3 • Published 3 years ago

fatesapi.js v1.0.3

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

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/npm@1.0.0

or

npm i @fates/npm --save


POST Stats

Constructor

FatesClient(client, token)
Arguments
ParameterTypeOptionalDescription
tokenStringNoThe API Auth Token found on your bots page.
clientSnowflakeNoThe 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")
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago