Skip to content

Commit 2a61a53

Browse files
committed
jsdoc, typings for getGameCounts
1 parent 0357931 commit 2a61a53

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

src/Client.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,18 @@ class Client {
284284
* })
285285
* .catch(console.log)
286286
*/
287-
287+
/**
288+
* Allows you to get player count along with the player count of each public game
289+
* @method
290+
* @name Client#getGameCounts
291+
* @param {MethodOptions} [options={}] Options
292+
* @return {Promise<GameCounts>}
293+
* @example
294+
* hypixel.getGameCounts().then((gameCounts) => {
295+
* console.log(gameCounts.mainLobby.players);
296+
* })
297+
* .catch(console.log)
298+
*/
288299
/**
289300
* Delete x (by default all) cache entries
290301
* @param {?number} amount Amount of cache to delete

src/structures/GameCounts.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ class GameCounts {
88
* @param {object} data
99
*/
1010
constructor (data) {
11-
/**
12-
* Current player count
13-
* @type {number}
14-
*/
1511
/**
1612
* Player count in Main lobby
1713
* @name GameCounts#mainLobby
@@ -132,6 +128,10 @@ class GameCounts {
132128
* @name GameCounts#queue
133129
* @type {object}
134130
*/
131+
/**
132+
* Current player count
133+
* @type {number}
134+
*/
135135
this.playerCount = data.playerCount;
136136
for (const game in data.games) {
137137
if (Object.prototype.hasOwnProperty.call(data.games, game)) {

typings/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ declare module 'hypixel-api-reborn' {
228228
* @description Allows you to get list of products
229229
*/
230230
getSkyblockBazaar(options?: methodOptions): Promise<Product[]>;
231+
/**
232+
* @description Allows you to get skyblock news
233+
*/
231234
getSkyblockNews(options?: methodOptions): Promise<SkyblockNews>;
232235
/**
233236
* @description Allows you to get player's network status
@@ -250,6 +253,10 @@ declare module 'hypixel-api-reborn' {
250253
* @description Allows you to get recent games of a player
251254
*/
252255
getRecentGames(options?: methodOptions): Promise<RecentGame[]>;
256+
/**
257+
* @description Allows you to get player count along with the player count of each public game
258+
*/
259+
getGameCounts(options?: methodOptions): Promise<GameCounts>;
253260
/**
254261
* @param ip - Valid IP/Hostname address
255262
* @description Pings the minecraft server of hypixel by default

0 commit comments

Comments
 (0)