(ARCHIVED) serverCount Examples

THIS DOCUMENTATION IS ARCHIVED AND DOES NOT CONTAIN UP TO DATE INFORMATION. PLEASE VISIT OUR NEW DOCUMENTATION AVAILABLE HERE.

JavaScript - Node.JS using node-fetch

This is currently the preferred method for posting your bots server count to DEL in node.

If you haven't already install node-fetch using the following command.

npm i node-fetch --save
const fetch = require("node-fetch");
const apiToken = "YOUR_API_TOKEN";
const guildCount = 0; // Replace this with your guild count - Must be a valid int.
const baseURL = "https://api.discordextremelist.xyz/v1"
const headers = {
"Content-Type": "application/json",
"Authorization": apiToken
};
const body = {
"guildCount": guildCount
};
fetch(`${baseURL}/bot`, { method: "POST", headers: headers, body: body})
.then((res) => {
return res.json()
})
.then((json) => {
console.log(json);
});