npm install wbl-api
a) Properly instantiating a new client.
const WblApi = require("wbl-api");
const BotID = "MY_BOTS_USER_ID";
const Token = "MY_WBL_API_TOKEN_FOR_MY_BOT";
const WblClient = new WblApi.Client({
"id": BotID,
"token": Token
});
b) Posting your server and shard count to the API.
setInterval(() => {
const myServerCount = client.guilds.cache.size; // ! Discord.js Code
WblClient.postCount(myServerCount).then(result => {
if (result.error) console.error("Failed to post the amount of guilds.");
else console.log("Posted amount of guilds to WBL API.")
});
}, 600000); // Every 20 minutes.
c) Retriving a list of users that upvoted your bot in last 12 to 24 hours.
WblClient.getVotes().then(response => {
console.log(`${response.data.length} Users have upvotes the bot in last 12 to 24 hours.`);
});
Name | Optional | Type | Description | Default |
---|---|---|---|---|
options.id | No | String | The id of your discord bot. | None |
options.token | No | String | The WBL API authorization token that belongs to your bot. | None |
Posts the server count and shard count to our API.
Name | Optional | Type | Description | Default |
---|---|---|---|---|
guildCount | No | String(Number) | The amount of servers your bot is in. | None |
shardCount | Yes | String(Number) | The amount of shards your bot has. | 1 |
Returns Promise<Object>
Returns an array of user ids that upvoted your bot in last 12 to 24 hours.
Returns Promise<Array<String>>