Package list golang-github-nlopes-slack / db453bc
Add example for billableInfo API's Damara 4 years ago
1 changed file(s) with 25 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
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 }