-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclient.ts
48 lines (36 loc) · 1.49 KB
/
client.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import BrawlStars from "../src/index"; // Change this on 'from "brawlstars-api-nodejs"'
const token = "your-api-token";
const client = new BrawlStars.client(token);
async function example() {
// Get player information
let player = await client.player("#player-tag");
console.log(player);
// Get club information
let club = await client.club("#club-tag");
console.log(club);
// Get club members
let members = await client.clubMembers("#club-tag");
console.log(members);
// Get battle log
let battleLog = await client.battleLog("#player-tag");
console.log(battleLog.history);
// Get list of all brawlers
let brawlers = await client.brawlers();
console.log(brawlers);
// Get information for a specific brawler
let brawler = await client.brawler(16000000);
console.log(brawler); // SHELLY
// Get list of all power play seasons
let powerPlaySeasons = await client.powerPlayRankingSeasons();
console.log(powerPlaySeasons);
// Get trophy ranking for a specific country
let trophyRanking = await client.trophyRanking("us");
console.log(trophyRanking.ranking);
// Get power play ranking for a specific season and country
let powerPlayRanking = await client.powerPlayRanking("latest", "us");
console.log(powerPlayRanking.ranking);
// Get brawler ranking for a specific brawler and country
let brawlerRanking = await client.brawlerRanking(16000000, "us");
console.log(brawlerRanking.ranking);
}
example();