Top.gg AutoPoster except it makes typescript a dev dep
i needed jpbberry/topgg-autoposter#6 right now so i made a fork to use it while waiting for it be merged
i guess ill deprecate this when it happens
Easy AutoPosting via the top.gg sdk
How to
It's really really simple! All you gotta do is:
const { AutoPoster } = require('@superchupu/topgg-autoposter')
const poster = AutoPoster('topggtoken', client)
poster.on('posted', (stats) => {
console.log(`Posted stats to Top.gg | ${stats.serverCount} servers`)
})
You can also do poster.on('error', (err) => { ... }) and this will stop errors from being logged and left for you to handle
And that's it!
It will begin to post your server count, and shard count every 30 minutes.
This even work on individual Discord.JS shards that are process separated.
If you would like to do specific clients, DJSPoster
& ErisPoster
& DJSSharderPoster
& RosePoster
are all exported classes!
Traditional Discord.JS Sharding:
If you use Discord.JS' traditional ShardingManager
sharder, you can also append the AutoPoster to the sharding manager like so:
const sharder = new Discord.ShardingManager(...)
const poster = AutoPoster('topggtoken', sharder)
sharder.spawn()
This will run broadcastEval's and automatically fetch your statistics!
const master = new Master(...)
const poster = AutoPoster('topggtoken', master)
And it will run everything through comms.getStats() function