-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi_champion.go
More file actions
28 lines (21 loc) · 792 Bytes
/
api_champion.go
File metadata and controls
28 lines (21 loc) · 792 Bytes
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
package riotapi
import "strconv"
// https://developer.riotgames.com/api/methods#!/1077
// ChampionStatus get the status of a current champion
// This is useful to see if the champ is free to play, enabled in ranked etc
func (c *APIClient) ChampionStatus() (cl *ChampionStatusList, err error) {
err = c.makeRequest("GET", "v1.2", "champion", nil, true, cl)
if err != nil {
return cl, err
}
return cl, err
}
// ChampionStatusByID get the status of a current champion
// This is useful to see if the champ is free to play, enabled in ranked etc
func (c *APIClient) ChampionStatusByID(id int) (cs *ChampionStatus, err error) {
err = c.makeRequest("GET", "v1.2", c.genURL([]string{"champion", strconv.Itoa(id)}), nil, true, cs)
if err != nil {
return cs, err
}
return cs, err
}