1.2.2 • Published 2 years ago
@foup/topgg v1.2.2
About
@foupp/topgg
is a API wrapper for Top.gg that allows you to manage your discord bot
- Quick setup
- Simple functions
Installation
npm install @foupp/topgg
Create a connection between your Top.gg bot and the API
import Client from '@foupp/topgg';
import Discord from 'discord.js';
const client = new Discord.Client();
const TopGGClient = new Client("TOPGG_WEBHOOK_TOKEN", client);
Afterwards we can create a quite simple example usage:
import DBL from '@foupp/topgg';
import { Client, GatewayIntentBits } from 'discord.js';
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
const TopGG = new DBL("webhook-token", client);
client.on('ready', async () => {
await TopGG.postStats({
server_count: 123
});
console.log(`Logged in as ${client.user.tag}!`);
});
TopGG.on("posted", () => console.log("Top.gg stats have been updated!"))
client.login('token');