Server Count API

post
Server Count

https://voidbots.net/api/auth/stats/:botid
This endpoint allows you to update the server count on the bot's page.
Request
Response
Request
Path Parameters
botid
required
string
ID of the bot to update.
Headers
Authentication
required
string
The auth token at the bottom of the edit page.
Body Parameters
server_count
required
string
The bot's new server count.
Response
200: OK
Cake successfully retrieved.
{
success: true,
old_servercount: "0",
servers: "85"
}
401: Unauthorized
The auth token from the edit page was not found within the post request.
{
success: false,
error: "Authorization header not found."
}

Don't forget to replace the auth token with your bot's Void Bots API token.

Make sure to place this within an event or command. If you do not you may get "Count not found in body" errors.

Discord.js v12 - Example
Discord.js v12 - Example
let fetch = require("node-fetch")
fetch(`https://voidbots.net/api/auth/stats/${client.user.id}`, {
method: "POST",
headers: {
Authorization: "YOUR_AUTH_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({"server_count": client.guilds.cache.size })
}).then(response => response.text())
.then(console.log).catch(console.error);

How to get your Auth Token

  1. Select Edit on the bot you want.

  2. Scroll to the bottom of the page.

  3. Click "Authorization Token".

  4. Copy your authorization token.

  5. Store it somewhere safe - don't share it! You will need it later.

‚Äč