0.0.9 • Published 1 year ago

@infinitybots/node-sdk v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Infinity Node SDK

Simple module for interacting with the Infinity Bot List API!

Quick Links


Install

npm i @infinitybots/node-sdk

or

npm i @infinitybots/node-sdk@latest

Infinity Poster

Post your Server, Shard or User Count

Request Headers

HeaderDescriptionValue
authYour bots IBL API TokenCan be found in the "edit bot" page
botIDYour bots Client IDShould be a discord snowflake

Usage Examples

Post Server Count

const { InfinityPoster } = require("@infinitybots/node-sdk")

const ibl = new InfinityPoster({
    auth: "YOUR_BOTS_API_KEY",
    botID: "YOUR_BOTS_ID"
});

ibl.postServerCount(SERVER_COUNT_HERE).catch((err) => {
    console.log(`${err.message}`)
})

console.log("Posted server count successfully");

Post Shard Count

const { InfinityPoster } = require("@infinitybots/node-sdk")

const ibl = new InfinityPoster({
    auth: "YOUR_BOTS_API_KEY",
    botID: "YOUR_BOTS_ID"
});

ibl.postShardCount(SHARD_COUNT_HERE).catch((err) => {
    console.log(`${err.message}`)
})

console.log("Posted shard count successfully");

Post User Count

const { InfinityPoster } = require("@infinitybots/node-sdk")

const ibl = new InfinityPoster({
    auth: "YOUR_BOTS_API_KEY",
    botID: "YOUR_BOTS_ID"
});

ibl.postUserCount(USER_COUNT_HERE).catch((err) => {
    console.log(`${err.message}`)
})

console.log("Posted user count successfully");

Infinity Fetcher

Fetch bot information such as checking if a user has voted!

User Vote Status

Check if a user has voted for your bot recently

ResponseDescriptionValue
has_votedIf the user has voted recentlyReturns true or false
last_vote_timeTime of the last logged voteReturns a hex value
premium_botIf the bot is premium or notReturns true or false
user_idID of the user who votedReturns a discord snowflake
vote_info.is_weekendIf weekend voting is enabledReturns true or false
vote_info.vote_timeThe time of the voteReturns a numerical value

Usage Example

const { InfinityFetcher } = require("@infinitybots/node-sdk")

const ibl = new InfinityFetcher({
    auth: "YOUR_BOTS_API_KEY",
    botID: "YOUR_BOTS_ID"
});

const results = await ibl.getUserVotes(USER_ID_HERE);

console.log(`${results.has_voted}`);

Get Bot Info

Fetch some Information about your bot from our API

ResponseDescriptionValue
bot_idThe Bots IDReturns a discord snowflake
bannerThe bots card banner on our siteReturns a image url
inviteThe bots invite linkReturns a discord client invite url
libraryLibrary the bot is made withReturns a library (ex: Discord.js)
staff_botIf the bot belongs to ibl staffReturns true or false
long_descThe bots long descriptionReturns a large string
short_descThe bots short descriptionReturns a small string
extra_linksThe bots links/extra linksReturns a array of links
statistics.serversThe bots server countReturns a numerical value
statistics.shardsThe bots shard countReturns a numerical value
statistics.usersThe bots user countReturns a numerical value
statistics.votesThe bots upvote countReturns a numerical value

Usage Example

const { InfinityFetcher } = require("@infinitybots/node-sdk")

const ibl = new InfinityFetcher({
    auth: "YOUR_BOTS_API_KEY",
    botID: "YOUR_BOTS_ID"
});

const results = await ibl.getBotInfo();

console.log(`${results.bot_id}`);
0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago