Page cover image

🏠Quick Start

Here you can find information to start using our api

Docs Pages

Get your bot's token

To use our api you need to use as authorization header your custom bot's token threw our website. To do that, follow the next steps:

Do not share/post your bot's token with no-one!

  1. Go to staxbotlist website.

  2. Click the "Login" button at the top right of your screen.

  3. When you have login in go to your profile by clicking again your name at the right corner of you screen.

  4. After that you should find your bot's profile. If you have not any bots submitted, make a new bot application and wait for verification.

  5. If you have a bot, click on his profile. You will find this box as the picture and after that click the "Copy" button.

  6. Then to start trying our api, you need to open the main file of your bot.

  7. Once you have opened that, copy the next basic code of posting the server count where you bot has joined.

On JavaScript language

ready.js
const fetch = require("node-fetch");
const client = new Client({...});

client.on("ready", () => {
    //Your bot's code
    fetch('https://staxbotlist.com/api/bots/stats', {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
            serverCount: client.guilds.cache.size,
            Authorization: "YOUR BOT'S TOKEN FOR THE WEBSITE"
        }
    })
    .then(req=>req.json())
    .then(res=>{
        console.log(`Success!`)
    
     })
});

On Python language

ready.py
import discord
import requests
import json

client = discord.Client()

@client.event
async def on_ready():
#Your bot's code
headers = {
"Content-Type": "application/json",
"serverCount": len(client.guilds),
"Authorization": "YOUR BOT'S TOKEN FOR THE WEBSITE"
}
response = requests.post('https://staxbotlist.com/api/bots/stats', headers=headers)
if response.ok:
print("Success!")

client.run("YOUR BOT'S DISCORD TOKEN")

In this way we can get information about your bot such as server, shard and more.

Last updated