Skip to content
This repository was archived by the owner on Jan 28, 2019. It is now read-only.

Posting Bot Stats

iDerp edited this page Mar 27, 2018 · 6 revisions

Posting your Bot Stats (Manual)

Lets start off by getting our data collected. In this example, we are going to be using client as the Discord client.


How to post stats if you are not sharding

It is very simple when you are not sharding. All you need to do is add the following code to where you need, such as on an event.

dbw.postStats(client.guilds.size);

And thats it!


How to post stats if you are sharding

It's a bit more to effort when sharding, but its not too bad. First off add the following code to where ever you need to call posting stats.

client.shard.fetchClientValues('guilds.size')
    .then(totalGuilds => {})

This will fetch all the guilds on all of the shards. Now all you need to do is add the following into it.

dbw.postStats(totalGuilds)

So your end result should look like this:

client.shard.fetchClientValues('guilds.size')
    .then(totalGuilds => {dbw.postStats(totalGuilds)})

Automated Bot Stats


Fully Automated

Automated stats posting is very easy. After passing true as seen here, there is nothing else that you need to do! This will also manage if you have shards too.


Semi-Automated

If you dont have it on full auto, you can also simply post stats by running dbw.postStats() without any args.

Clone this wiki locally