Codebase list golang-github-nlopes-slack / 0c92f27
Add example for InvalidAuthEvent Norberto Lopes 8 years ago
1 changed file(s) with 7 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1212 rtm := api.NewRTM()
1313 go rtm.ManageConnection()
1414
15 Loop:
1516 for {
1617 select {
1718 case msg := <-rtm.IncomingEvents:
3839 case *slack.RTMError:
3940 fmt.Printf("Error: %s\n", ev.Error())
4041
42 case *slack.InvalidAuthEvent:
43 fmt.Printf("Invalid credentials")
44 break Loop
45
4146 default:
47
4248 // Ignore other events..
43 //fmt.Printf("Unexpected: %v\n", msg.Data)
49 // fmt.Printf("Unexpected: %v\n", msg.Data)
4450 }
4551 }
4652 }