Package list golang-github-nlopes-slack / ea1511c
Add channels example Norberto Lopes 5 years ago
1 changed file(s) with 19 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 channels, err := api.GetChannels(false)
11 if err != nil {
12 fmt.Printf("%s\n", err)
13 return
14 }
15 for _, channel := range channels {
16 fmt.Println(channel.ID)
17 }
18 }