Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Latest commit

 

History

History
808 lines (585 loc) · 28.7 KB

README.md

File metadata and controls

808 lines (585 loc) · 28.7 KB

WarCord

This is a package to simplify use of Wargaming API.

BUILD NPM_DOWNLOADS NPM_LICENSE NPM_VERSION PULL_REQUESTS

NPM


Initial Files:

const { WarCord } = require('warcord')
const warcord = new WarCord('your-app-id')

Credits


World of Tanks

World of Tanks Blitz

World of WarShips

World of Tanks Console


WOTCClan

Kind: global class

wotcClan.search(options) ⇒ Promise.<(Array.<WOTCClanSearch>|void)>

Method returns partial list of clans in alphabetical order by clan name or tag.

Kind: instance method of WOTCClan
Returns: Promise.<(Array.<WOTCClanSearch>|void)> - Array of clans.

Param Type Description
options Object Options Object

Properties

Name Type Default Description
options.language AcceptedLangs | string Localization language.
[options.limit] number 100 Number of returned entries (fewer can be returned, but not more than 100). If the limit sent exceeds 100, a limit of 100 is applied (by default).
options.search string Part of name or tag for clan search. Minimum 2 characters

wotcClan.get(clan_id, options) ⇒ Promise.<(WOTCClanGet|void)>

Method returns detailed clan information.

Kind: instance method of WOTCClan
Returns: Promise.<(WOTCClanGet|void)> - Clan data.

Param Type Description
clan_id Clan ID
options Object Options Object

Properties

Name Type Description
options.language AcceptedLangs | string Localization language.
options.members boolean Return with the members info.

WOWSClans

Kind: global class

wowsClans.get(clanID) ⇒ Promise.<(WOWSClansResolve|null)>

Get a clan in World of WarShips.

Kind: instance method of WOWSClans
Returns: Promise.<(WOWSClansResolve|null)> - Clan data.

Param Type Description
clanID number | string ID of clan.

wowsClans.search(clanNameOrTag) ⇒ Promise.<(WOWSClansSearchResolve|null)>

Get a array with clans data of respective name.

Kind: instance method of WOWSClans
Returns: Promise.<(WOWSClansSearchResolve|null)> - Array with clan data.

Param Type Description
clanNameOrTag string Name or Tag of clan.

WOTBClan

Kind: global class

wotbClan.get(clanID) ⇒ Promise.<(WOTBClanResolve|null)>

Get a clan in World of Tanks Blitz.

Kind: instance method of WOTBClan
Returns: Promise.<(WOTBClanResolve|null)> - Clan data.

Param Type Description
clanID string | number ID of clan.

Example

...
const clan = await <Warcord>.blitz.clan.get('ID of Clan')

wotbClan.search(clanNameOrTag) ⇒ Promise.<(Array.<ClanSearchBlitz>|null)>

Get the ID's and Name of the putted name.

Kind: instance method of WOTBClan
Returns: Promise.<(Array.<ClanSearchBlitz>|null)> - The clan ID's and Name.

Param Type Description
clanNameOrTag string ID or Tag of the clan.

Example

...
const searchingClan = await <Warcord>.blitz.clan.search('Name or Tag of Clan')
//this returns an array of the clans found

const clan = await <Warcord>.blitz.clan.get(searchingClan[0].clan_id)
//this returns the first clan data.

WOTClan

Kind: global class

wotClan.get(clanID, options) ⇒ Promise.<(WOTClanResolve|null)>

Get a clan in World of Tanks.

Kind: instance method of WOTClan
Returns: Promise.<(WOTClanResolve|null)> - Clan data.

Param Type Description
clanID string ID of clan.
options Object Options Object.

Properties

Name Type Description
options.realm AllRealms The realm of query.

Example

...
const clan = await <Warcord>.wot.clan.get('ID of Clan')

wotClan.search(clanNameOrTag, options) ⇒ Promise.<(Array.<WOTClanSearchResolve>|null)>

Get a array with clans data of respective name.

Kind: instance method of WOTClan
Returns: Promise.<(Array.<WOTClanSearchResolve>|null)> - Array with clan data.

Param Type Description
clanNameOrTag string Name or Tag of clan.
options Object Options Object.

Properties

Name Type Description
options.realm AllRealms The realm of query.

Example

...
const searchingClan = await <Warcord>.wot.clan.search('Name or Tag of Clan')
//this returns an array of the clans found.

const clan = await <Warcord>.wot.clan.get(searchingClan[0].clan_id)
//this returns the first clan data.

wotClan.rating(clanID, options) ⇒ Object

Get the rating of an Clan.

Kind: instance method of WOTClan
Returns: Object - Clan rating.

Param Type Description
clanID string | number ID of Clan.
options Object Options Object.

Properties

Name Type Description
options.realm AllRealms The realm of query.

Example

...
const ratingOfClan = await <Warcord>.wot.clan.rating('ID of Clan')

wotClan.member(memberID, options) ⇒ Promise.<(WOTMember|null)>

Get the clan member data.

Kind: instance method of WOTClan
Returns: Promise.<(WOTMember|null)> - Clan Member data.

Param Type Description
memberID string | number ID of Clan Member.
options Object Options Object.

Properties

Name Type Description
options.realm AllRealms The realm of query.

Example

const memberOfClan = await <Warcord>.wot.clan.member('ID of Member')

WOWSEncyclopedia

Kind: global class

wowsEncyclopedia.get()

Deprecated

Kind: instance method of WOWSEncyclopedia

wowsEncyclopedia.find(ops) ⇒ Promise.<(Array.<WOWSLongPediaResolve>|Array.<WOWSPediaResolve>|null)>

Get a ship based on params.

Kind: instance method of WOWSEncyclopedia

Param Type
ops object

Properties

Name Type Default Description
ops.nation string The nation of ship.
ops.type string The type of ship.
ops.options object Options of query.
[ops.options.limit] number 100 The limit of ships finded.
[ops.options.lang] string "en" The Language of Texts.

Example

...
const getShip = await <WarCord>.wows.ship.find({ nation: 'japan', options: { lang: 'pt-br', limit: 100 } })

wowsEncyclopedia.shipParams(ship_id, options) ⇒ Promise.<(WOWSShipParams|null)>

Get the parameters of a ship

Kind: instance method of WOWSEncyclopedia
Returns: Promise.<(WOWSShipParams|null)> - Parameters of ships in all existing configurations.

Param Type Description
ship_id Ship ID
options Object Options Object

Properties

Name Type Default Description
options.artillery_id string | number Main Battery ID. If the module is not indicated, module of basic configuration is used.
options.dive_bomber_id string | number Dive bombers' ID. If the module is not indicated, module of basic configuration is used.
options.engine_id string | number Engine ID. If the module is not indicated, module of basic configuration is used.
options.fighter_id string | number Fighters' ID. If the module is not indicated, module of basic configuration is used.
options.fire_control_id string | number ID of Gun Fire Control System. If the module is not indicated, module of basic configuration is used.
options.flight_control_id string | number ID of Flight Control System. If the module is not indicated, module of basic configuration is used.
options.hull_id string | number Hull ID. If the module is not indicated, module of basic configuration is used.
[options.language] string | number "en" Localization language.
options.torpedo_bomber_id string | number Torpedo bombers' ID. If the module is not indicated, module of basic configuration is used.
options.torpedoes_id string | number Torpedo tubes' ID. If the module is not indicated, module of basic configuration is used.

WOWSShip

Kind: global class

wowsShip.get(userID) ⇒ Promise.<(Array.<WOWSShipResolve>|null)>

Get the ships status of an user.

Kind: instance method of WOWSShip

Param Type Description
userID string the ID of user.

wowsShip.find(ops) ⇒ Promise.<(Array.<WOWSLongShipResolve>|Array.<WOWSShipResolve>|null)>

Get a ship based on params.

Kind: instance method of WOWSShip

Param Type
ops Object

Properties

Name Type Default Description
ops.nation string The nation of ship.
ops.string string The type of ship.
ops.options Object Options of query.
[ops.options.limit] number 100 The limit of ships finded.
[ops.options.lang] string "en" The Language of Texts.

WOTBTank

Kind: global class

wotbTank.get(tankID) ⇒ Promise.<(WOTBTankResolve|null)>

Get the tank by ID.

Kind: instance method of WOTBTank

Param Type
tankID string | number

WOTTank

Kind: global class

wotTank.find(type, nation, tier, options) ⇒ Promise.<(WOTTanksResolve|null)>

Get all tanks of parameters.

Kind: instance method of WOTTank
Returns: Promise.<(WOTTanksResolve|null)> - Returns all tanks finded.
Exemple: ...

const getTank = await .wot.tank.find('heavyTank')

Param Type Description
type string type of tank.
nation WOTNations The nation of tank.
tier string The tier of tank.
options Object The options object.

Properties

Name Type Default Description
options.realm AllRealms The realm of query.
[options.limit] number 100 Limit of returned data.
[options.lang] WOTLangs en The language of Texts.

wotTank.get(tankID) ⇒ Promise.<(WOTTanksResolve|null)>

Get a tank by ID.

Kind: instance method of WOTTank
Returns: Promise.<(WOTTanksResolve|null)> - Object with Tank Data.

Param Type Description
tankID number | string ID of Tank.

Example

...
const tank = await <WarCord>.wot.tank.get('ID of Tank')

WOTCTankopedia

Kind: global class

wotcTankopedia.search(options) ⇒ Promise.<(Array.<WOTCTank>|void)>

Method returns list of available vehicles.

Kind: instance method of WOTCTankopedia
Returns: Promise.<(Array.<WOTCTank>|void)> - An array with search data.

Param Description
options Options Object

Properties

Name Type Description
options.language AcceptedLangs | Array.<AcceptedLangs> Localization language.
options.nation AcceptedNations | Array.<AcceptedNations> Nation.
options.tank_id number | Array.<number> Vehicle ID.
options.tier number | Array.<number> Tier.

WOTBTournaments

Kind: global class

Param Type Default Description
app_id string The ID of your WarGaming App.
[realm] string "na" Server Location Not valid for World of Tanks Console (WOTC)..

wotbTournaments.find(options) ⇒ Promise.<(Array.<WOTBTournamentsSearch>|null)>

Search tournaments in API.

Kind: instance method of WOTBTournaments
Returns: Promise.<(Array.<WOTBTournamentsSearch>|null)> - The search data.

Param Type Description
options Object Options Object

Properties

Name Type Default Description
[options.language] AcceptedLanguagesWOTBTournaments | string "en" Localization language.
[options.limit] number 10 Number of returned entries. Min value is 1. Maximum value: 25.
options.search string First letters in tournament name for search. Minimum length: 2 characters. Maximum length: 50 characters.
options.status StautsTournaments | Array.<StautsTournaments> Tournament status.

wotbTournaments.get(tourID, options) ⇒ Promise.<(WOTBTournamentsGet|null)>

Get a tournamente by ID.

Kind: instance method of WOTBTournaments
Returns: Promise.<(WOTBTournamentsGet|null)> - The tournament data.

Param Type Description
tourID string Tournament ID that can be retrieved from the find method.
options Object The Options Object

Properties

Name Type Description
options.language AcceptedLanguagesWOTBTournaments | string Localization language.

wotbTournaments.getResult(tourID, options) ⇒ Promise.<(WOTBTourResult|null)>

Used to get the tournament result.

Kind: instance method of WOTBTournaments
Returns: Promise.<(WOTBTourResult|null)> - Tournament Result.

Param Type Description
tourID Tournament ID that can be retrieved from the find method.
options Object Options Object

Properties

Name Type Default Description
language AcceptedLanguagesWOTBTournaments Localization language.
[limit] number 10 Number of returned entries.
team_id string Team ID.

WOWSUser

Kind: global class

Param Type Default Description
app_id string The ID of your WarGaming App.
[realm] string "na" Server Location Not valid for World of Tanks Console (WOTC)..

wowsUser.search(userName) ⇒ Promise.<(Array.<UserSearchResolve>|null)>

Search users with respective name.

Kind: instance method of WOWSUser
Returns: Promise.<(Array.<UserSearchResolve>|null)> - Object Array with users data.

Param Type Description
userName string Name of user.

wowsUser.get(userID) ⇒ Promise.<(WOWSUserResolve|null)>

Get an user by ID.

Kind: instance method of WOWSUser
Returns: Promise.<(WOWSUserResolve|null)> - Object of user data.

Param Type Description
userID number | string ID of user.

wowsUser.achievements(account_id, options) ⇒ Promise.<({battle: any, progress: any}|null)>

Get all achievements of an user.

Kind: instance method of WOWSUser
Returns: Promise.<({battle: any, progress: any}|null)> - The achievements of user.

Param Type Description
account_id Player account ID.
options Object Options Object

Properties

Name Type Description
options.language AcceptedLangs Localization language.

wowsUser.shipStats(account_id) ⇒ Promise.<(Array.<WOWSPediaResolve>|null)>

Get the ships status of an user.

Kind: instance method of WOWSUser

Param Type Description
account_id string the ID of user.

Example

...
const ships = await <Warcord>.wows.user.shipStats('ID of User')

WOTBUser

Kind: global class

wotbUser.get(userID) ⇒ Promise.<(WOTBUserResolve|null)>

Get the user data by ID.

Kind: instance method of WOTBUser

Param Type
userID string | number

Example

...
const user = await <Warcord>.blitz.user.get('Wargaming ID of User')

wotbUser.search(userName) ⇒ Promise.<(UserSearchResolve|null)>

Get all users with the putted name.

Kind: instance method of WOTBUser

Param Type
userName string

Example

...
const searchingUser = await <Warcord>.blitz.user.search('Wargaming NickName of User')
//this returns an array of the users found.

const user = await <Warcord>.blitz.user.get(searchingUser[0].id)
//this returns the first user data.

wotbUser.topTanks(userID) ⇒ Promise.<(WOTBTankTop|null)>

Get the best 5 tanks of an user.

Kind: instance method of WOTBUser

Param Type
userID string | number

Example

...
const tank = await <Warcord>.blitz.user.topTanks('Wargaming ID of User')

WOTUser

Kind: global class

wotUser.search(userName, options) ⇒ Promise.<(Array.<UserSearchResolve>|null)>

Search users with respective name.

Kind: instance method of WOTUser
Returns: Promise.<(Array.<UserSearchResolve>|null)> - Object Array with users data.

Param Type Description
userName string Name of user.
options Object Options Object.

Properties

Name Type Description
options.realm AllRealms The realm of query.

Example

...
const searchingUser = await <Warcord>.wot.user.search('Wargaming NickName of User')
//this returns an array of the users found.

const user = await <Warcord>.wot.user.get(searchingUser[0].id)
//this returns the first user data.

wotUser.get(userID, options) ⇒ Promise.<(WOTUserResolve|null)>

Get an user by ID.

Kind: instance method of WOTUser
Returns: Promise.<(WOTUserResolve|null)> - Object of user data.

Param Type Description
userID number | string ID of user.
options Object Options Object.

Properties

Name Type Description
options.realm AllRealms The realm of query.

Example

...
const user = await <Warcord>.wot.user.get('Wargaming ID of User')

wotUser.topTanks(userID, options) ⇒ Promise.<(Array.<WOTTopTanksResolve>|null)>

Get the 5 best tanks of user.

Kind: instance method of WOTUser
Returns: Promise.<(Array.<WOTTopTanksResolve>|null)> - Object Array with tanks data.

Param Type Description
userID number | string ID of user.
options Object Options Object.

Properties

Name Type Description
options.realm AllRealms The realm of query.

Example

...
const topTanks = await <Warcord>.wot.user.topTanks('Wargaming ID of User')