Add example for billableInfo API's
Damara
7 years ago
0 | package main | |
1 | ||
2 | import ( | |
3 | "fmt" | |
4 | ||
5 | "github.com/nlopes/slack" | |
6 | ) | |
7 | ||
8 | func main() { | |
9 | api := slack.New("YOUR_TOKEN_HERE") | |
10 | //Example for single user | |
11 | billingActive, err := api.GetBillableInfo("U023BECGF") | |
12 | if err != nil { | |
13 | fmt.Printf("%s\n", err) | |
14 | return | |
15 | } | |
16 | fmt.Printf("ID: U023BECGF, BillingActive: %v\n\n\n", billingActive["U023BECGF"]) | |
17 | ||
18 | //Example for team | |
19 | billingActiveForTeam, err := api.GetBillableInfoForTeam() | |
20 | for id, value := range billingActiveForTeam { | |
21 | fmt.Printf("ID: %v, BillingActive: %v\n", id, value) | |
22 | } | |
23 | ||
24 | } |