UNPKG

akira.js

Version:

An api wrapper for Akira list API

43 lines (39 loc) 1.02 kB
const fetch = require("node-fetch"); module.exports = class UDL { constructor(token, client) { this["token"] = token; this["client"] = client; return this; } serverCount(message) { fetch(`https://www.akira.gay/api/bots/stats`, { method: "POST", headers: { serverCount: this.client.guilds.cache.size, "Content-Type": "application/json", Authorization: this.token, }, }).then(console.log(message || "Server count posted.")); }; async hasVoted(id) { return await fetch(`https://www.akira.gay/api/bots/check/${id}`, { method: "GET", headers: { "Content-Type": "application/json", Authorization: this.token, }, }) .then((res) => res.json()) .then(async (json) => json.voted); }; async botInfo(id) { return await fetch(`https://www.akira.gay/api/bots/${id}`, { method: "GET", headers: { "Content-Type": "application/json" }, }) .then((res) => res.json()) .then(async (json) => json); }; };