Paths

"Where do I POST stuff?!" Right here, my lost squirrel!

STOP!

Before you continue, you will need your API token.

When your bot has been submitted, and is (hopefully) approved, you will gain access to the dbo token [@bot] command. By default, no API token is generated. If you do dbo token True @yourbot, it will create one and DM you it.

If you already have one, and DON'T want to regenerate it, run dbo token @yourbot.

If you DO want to reset it, do dbo token True @yourbot again.

There is a ratelimit to this command. 10 minute cooldown if you invoke it 3 times in 10 minutes.

Actual Paths

post
Stats

https://bots.dragdev.xyz/bots/:id/stats
Post stats to our list. Visible on your bot's page and on dbo getbots {your bot} command
Request
Response
Request
Path Parameters
ID
required
number
The ID of the bot you are posting stats for
Headers
commands
optional
number
Total amount of commands your bot has. Defaults to 0
shards
optional
integer
The number of shards your bot has. Defaults to 0
guilds
optional
integer
number of guilds your bot is in. Defaults to None
Auth
required
string
The API token you got for your bot (above)
Response
200: OK
You posted your bot's stats with no issue!
{
"successful": true,
"error": null,
"status": 200
}
400: Bad Request
You either did not provide an authorisation header (Auth) or did not provide any headers at all
{
"successful": false,
"error": "No [authorization] headers",
"status": 400
}
403: Forbidden
You did not provide the correct API token || Bot has not yet been approved
{
"successful": false,
"error": "Invalid API token provided." OR "Bot has not been approved yet.",
"status": 403
}
404: Not Found
The bot you tried posting stats for has not been submitted, or is not in our server (in which case it was deleted)
{
"successful": false,
"error": "provided bot is not in our server or has not been tested.",
"status": 404
}
429: Too Many Requests
You are sending too many requests. You can only send 1 request (per bot) per 10 minutes.
{
"successful": false,
"error": "You must wait 10 minutes between each request!",
"status": 429,
"retry_after": seconds (ranging from 0.001 to 600)
}
500: Internal Server Error
An error occurred when processing your request, probably because a header (excluding Auth) was not an integer
{
"successful": false,
"error": "Error occurred when getting details from headers. are all headers integers? (excluding auth)",
"status": 500
}

get
stats

https://bots.dragdev.xyz/bots/:id/stats
Gets the stats
Request
Response
Request
Path Parameters
Auth
optional
string
The authorisation token for the bot with id :i
Response
200: OK
if Auth was provided, returns a JSON response (below). Otherwise, returns HTML that displays the bot's name, shard count, guild count, command count and owner.
JavaScript
HTML
JavaScript
{
"status": 200,
"bot_id": int[:id],
"guilds": int || null,
"commands": int || null,
"shards": int || null,
"author_id": int
}
HTML
<h1>BOTNAME#TAG0's stats:</h1><br>
Servers: <strong>Integer</strong><br>
Shards: <strong>Integer</strong><br>
Commands: <strong>Integer</strong><br><br>
Owner: OWNERNAME#TAG0
400: Bad Request
:id parameter was not an integer
{
"status": 400,
"error": "provided ID is not integer",
"successful": false
}

POSTing server count example

Python (aiohttp):

headers = {
"Auth": "YOUR_API_TOKEN",
"guilds": len(bot.guilds)
"shards": bot.shard_count or None,
"commands": len(bot.commands) # alternatively, len(set(bot.walk_commands()))
# if you wanted to get all sub commands.
}
# the only required field there is Auth, but if the rest are none, it will
# just reset it.
async with aiohttp.ClientSession() as session:
async with session.post(f"https://bots.dragdev.xyz/bots/{bot.user.id}/stats",
headers=headers) as response:
JSON = await response.json()
if not JSON["successful"]:
print(f"Got code {JSON['status']} when POSTing stats to dragbots: {JSON['error']}")
elif JSON["successful"]:
print(f"Successfully posted stats to DragBots.")
await session.close()

What will the API return?

All of our responses are JSON*. This means, you can interpret them as your language's dictionary.

If your request was successful, you will get below (or similar) data:

{
"successful": true,
"status": 200,
"error": null
}

*Check above