Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,25 @@ module.exports = class ComlinkStub {
throw (error);
});
};
};

// https://github.com/swgoh-utils/swgoh-comlink/wiki/Getting-Started#getguildleaderboard
async getGuildLeaderboard(leaderboardType, defId, monthOffset, count, enums = false) {
const requestObject = {
"payload": {
"leaderboardId":[
{
"leaderboardType": leaderboardType,
"defId": defId || null,
"monthOffset": monthOffset || 0
}
],
"count": count
},
"enums": enums
};

return await this._postRequestPromiseAPI(`/getGuildLeaderboard`, requestObject).catch((error) => {
throw (error);
});
};
};
6 changes: 5 additions & 1 deletion index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ const postMethodArray = [
method: 'getPlayerArenaProfile',
path: '/playerArena',
parameters: [null, 'aPlayerId', true]
}], [{
method: 'getGuildLeaderboard',
path: '/getGuildLeaderboard',
parameters: [3, null, 0, 10, false]
}]
];

Expand Down Expand Up @@ -237,4 +241,4 @@ describe('ComlinkStub API bindings', () => {
expect.assertions(1);
});
});
});
});