2016-09-05 07:34:37 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/nlopes/slack"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
api := slack.New("YOUR_TOKEN_HERE")
|
|
|
|
channels, err := api.GetChannels(false)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
for _, channel := range channels {
|
2017-07-16 05:29:46 -07:00
|
|
|
fmt.Println(channel.Name)
|
|
|
|
// channel is of type conversation & groupConversation
|
|
|
|
// see all available methods in `conversation.go`
|
2016-09-05 07:34:37 -07:00
|
|
|
}
|
|
|
|
}
|