Constructor
new WorldRequest()
Methods
(async) send() → {Promise.<types.World>}
Returns:
- Type
- Promise.<types.World>
setBannerQuery(…banners) → {this}
Define the banners to be queried. Only affects requests containing the
WorldShard.BANNER shard.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
banners |
string |
<repeatable> |
IDs of the desired banners |
Returns:
The request, for chaining
- Type
- this
setCensusLeaderboardOptions(scalenullable, offsetnullable) → {this}
Define a custom CensusScale and rank to start compiling from.
Affects queries of the WorldShard.CENSUS_RANKS shard. If this is
not set, API uses the day's featured scale, and starts from rank 1.
Note that the NS API uses the same argument name for the custom scale
both here and for queries of all shards listed for the
WorldRequest#setCensusScales function, and setting it here will
thus override any previously set via it in this request instance.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
scale |
number |
<nullable> |
ID of the desired World Census scale; |
|
offset |
number |
<nullable> |
1 | Rank from which to start (inclusive); |
Returns:
The request, for chaining
- Type
- this
setCensusScales(…scales) → {this}
Define one or more CensusScales to query. Affects requests
containing the WorldShard.CENSUS,
WorldShard.CENSUS_DESCRIPTION, WorldShard.CENSUS_NAME,
WorldShard.CENSUS_RANKS, and WorldShard.CENSUS_TITLE
shards. If this is not set, the API uses the day's featured scale.
Only the CENSUS shard displays results for more than one scale. The
others will only return data for the first one specified.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
scales |
number |
<repeatable> |
IDs of the census scales to request; |
Returns:
The request, for chaining
- Type
- this
setDispatch(id) → {this}
Set the ID of the dispatch to be queried. Only affects requests
containing the WorldShard.DISPATCH shard.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
number | ID of the desired dispatch |
Returns:
The request, for chaining
- Type
- this
setDispatchSearchOptions(authornullable, categorynullable, subcategorynullable, searchModenullable) → {this}
Define custom criteria by which to query dispatches. Only affects
requests containing the WorldShard.DISPATCH_LIST shard.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
author |
string |
<nullable> |
Name of the nation to exclusively query the
dispatches of; |
category |
string |
<nullable> |
|
subcategory |
string |
<nullable> |
|
searchMode |
string |
<nullable> |
|
Returns:
The request, for chaining
- Type
- this
setFactionID(fid) → {this}
Specify the ID of the N-Day faction to request details on. Only affects
requests containing the WorldShard.FACTION shard.
Parameters:
| Name | Type | Description |
|---|---|---|
fid |
number | ID of the desired faction. |
Returns:
The request, for chaining.
- Type
- this
setHappeningsFilters(…filters) → {this}
Limit the list of happening events to be queried to those matching one
of the given filters. Only affects requests containing the
WorldShard.HAPPENINGS shard.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
filters |
string |
<repeatable> |
|
Returns:
The request, for chaining
- Type
- this
setHappeningsLimit(limit) → {this}
Set a limit for how many happening events may be returned. Only affects
requests containing the WorldShard.HAPPENINGS shard.
Parameters:
| Name | Type | Description |
|---|---|---|
limit |
number | Maximum number of happenings to return. Values below
|
Returns:
The request, for chaining
- Type
- this
setHappeningsNations(…nations) → {this}
Specify one or more nations from which alone to query happening events.
Only affects requests containing the WorldShard.HAPPENINGS
shard. Targets set via WorldRequest#setHappeningsRegions will be
overwritten!
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
nations |
string |
<repeatable> |
Name(s) of the desired nations. |
Returns:
The request, for chaining.
- Type
- this
setHappeningsRegions(…regions) → {this}
Specify one or more regions from which alone to query happening events.
Only affects requests containing the WorldShard.HAPPENINGS
shard. Targets set via WorldRequest#setHappeningsNations will be
overwritten!
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
regions |
string |
<repeatable> |
Name(s) of the desired regions. |
Returns:
The request, for chaining.
- Type
- this
setHappeningsWindowID(startnullable, endnullable) → {this}
Limit the list of happening events to be queried to those occurring
after and before the happening events with the specified IDs. Only
affects requests containing the WorldShard.HAPPENINGS shard.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
start |
number |
<nullable> |
ID of the happening event from which on to return
happening events; |
end |
number |
<nullable> |
ID of the happening event up to which to return
happening events; |
Returns:
The request, for chaining
- Type
- this
setHappeningsWindowTime(startnullable, endnullable) → {this}
Limit the list of happening events to be queried to those occurring
after and before the given timestamps. Only affects requests containing
the WorldShard.HAPPENINGS shard.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
start |
number |
<nullable> |
Timestamp from which on to return happening events;
|
end |
number |
<nullable> |
Timestamp up to which to return happening events;
|
Returns:
The request, for chaining
- Type
- this
setPoll(id) → {this}
Set the ID of the poll to query. Only affects requests containing the
WorldShard.POLL shard.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
number | ID of the desired poll |
Returns:
The request, for chaining
- Type
- this
setRegionSearchTags(…tags) → {this}
Specify tags to query regions by. Only affects requests containing the
WorldShard.REGIONS_BY_TAG shard.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tags |
string |
<repeatable> |
|
Returns:
The request, for chaining
- Type
- this