Constructor
new Client(optionsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
ClientOptions |
<optional> |
The options to configure. |
Members
(readonly) endpoint :string
The endpoint to use for interaction with botlist.space.
The version number is missing; Fulfilled only when fetching/posting.
Type:
- string
stats :Array.<Stats>
An array of the latest fetched Statistics, from oldest to newest.
Type:
- Array.<Stats>
Methods
edit(optionsopt, presetopt) → {ClientOptions}
Edit the options of the Client.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
ClientOptions |
<optional> |
{} | The options to change. |
preset |
boolean |
<optional> |
false | If true, uses the default ClientOpts as a target copy. Otherwise, Client#options is used. |
Returns:
- Type
- ClientOptions
(async) fetchBot(idopt, optionsopt) → {Promise.<Bot>}
Fetch a bot listed on botlist.space.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string | FetchOptions |
<optional> |
this.options.botID | The ID of the bot to fetch. Not required if this.options.botID is set. Can be FetchOptions, uses [options.botID](ClientOpts#bot) if so |
options |
FetchOptions |
<optional> |
{} | Options to pass. |
Returns:
A bot object.
- Type
- Promise.<Bot>
(async) fetchBots(optionsopt) → {Promise.<(Array.<Bot>|Store.<string, Bot>)>}
Fetch all bots listed on botlist.space.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
MultiFetchOptions |
<optional> |
{} | Options to pass. |
Returns:
(async) fetchBotsOfUser(id, optionsopt) → {Promise.<Array.<Bot>>}
Fetches all bots that a user owns.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string | A user ID to fetch bots from. | ||
options |
MultiFetchOptions |
<optional> |
{} | Options to pass. |
Returns:
- Type
- Promise.<Array.<Bot>>
(async) fetchStats(optionsopt) → {Promise.<Stats>}
Fetch botlist.space statistics.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
FetchOptions |
<optional> |
{} | Options to pass. (Ignores cache) |
Returns:
The statistics.
- Type
- Promise.<Stats>
(async) fetchUpvotes(idopt, optionsopt) → {Promise.<(Array.<Upvote>|Store.<string, Upvote>)>}
Fetch a bot's upvotes in the current month. Requires a bot token.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string | MultiFetchOptions |
<optional> |
this.options.botID | The bot ID to fetch upvotes from. Can be FetchOptions, uses [options.botID](ClientOpts#bot) if so |
options |
MultiFetchOptions |
<optional> |
{} | Options to pass. |
Returns:
An array of upvotes.s
(async) fetchUser(id, optionsopt) → {Promise.<User>}
Fetch a user logged onto botlist.space.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string | The user ID to fetch from the API. | ||
options |
FetchOptions |
<optional> |
{} | Options to pass. |
Returns:
A user object.
- Type
- Promise.<User>
(async) postCount(idopt, optionsopt) → {object}
Post your server count to botlist.space.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string | PostOptions | number | Array.<number> |
<optional> |
this.options.botID | The bot ID to post server count for. Not required if a bot ID was supplied. Can be PostOpts if using the bot ID supplied from ClientOpts. Can also be PostOpts#countOrShards if a number/array of numbers/null. |
options |
PostOptions |
<optional> |
{} | Options to pass. Overriden by the `id` parameter if `id` is PostOpts/number/array of numbers/null. |
Returns:
An object that satisfies your low self-esteem reminding you it was successive on post.
- Type
- object