-
Notifications
You must be signed in to change notification settings - Fork 1
Posting Bot Stats
Lets start off by getting our data collected. In this example, we are going to be using client as the Discord client.
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!
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 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.
If you dont have it on full auto, you can also simply post stats by running dbw.postStats() without any args.
The unofficial DBW API module (discordbotworld-api) is created by iDerp (iDerp#3616 on Discord)