Skip to content

Commit

Permalink
Update nlopes/slack dep to work with latest Slack api changes
Browse files Browse the repository at this point in the history
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
  • Loading branch information
PrasadG193 committed Nov 19, 2019
1 parent 5138bf4 commit 40031d4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,7 +1,7 @@
language: go

go:
- '1.12'
- '1.13'

services:
- docker
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Expand Up @@ -26,7 +26,7 @@ require (
github.com/mattermost/mattermost-server v5.11.1+incompatible
github.com/mattn/go-sqlite3 v1.11.0 // indirect
github.com/nicksnyder/go-i18n v1.10.1 // indirect
github.com/nlopes/slack v0.5.1-0.20190623232825-2891986e2a3e
github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249
github.com/olivere/elastic v6.2.21+incompatible
github.com/onsi/ginkgo v1.10.2 // indirect
github.com/pborman/uuid v1.2.0 // indirect
Expand Down Expand Up @@ -55,3 +55,5 @@ require (
k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d // indirect
)

go 1.13
2 changes: 2 additions & 0 deletions go.sum
Expand Up @@ -145,6 +145,8 @@ github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDa
github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4=
github.com/nlopes/slack v0.5.1-0.20190623232825-2891986e2a3e h1:4X/3/ywN6f+XITaDoI9GjXbF7MHk7fuunXsEWZX1GLc=
github.com/nlopes/slack v0.5.1-0.20190623232825-2891986e2a3e/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk=
github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249 h1:Pr5gZa2VcmktVwq0lyC39MsN5tz356vC/pQHKvq+QBo=
github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk=
github.com/olivere/elastic v6.2.21+incompatible h1:QnTuofzxOCV5FrYLywjkMxOmOWhAeild1VXxKRksK9Y=
github.com/olivere/elastic v6.2.21+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
Expand Down
9 changes: 8 additions & 1 deletion pkg/bot/slack.go
Expand Up @@ -66,7 +66,7 @@ func (b *SlackBot) Start() {
for msg := range RTM.IncomingEvents {
switch ev := msg.Data.(type) {
case *slack.ConnectedEvent:
logging.Logger.Debug("Connection Info: ", ev.Info)
logging.Logger.Debug("BotKube connected!")

case *slack.MessageEvent:
// Skip if message posted by BotKube
Expand All @@ -84,9 +84,16 @@ func (b *SlackBot) Start() {
case *slack.RTMError:
logging.Logger.Errorf("Slack RMT error: %+v", ev.Error())

case *slack.IncomingEventError:
logging.Logger.Errorf("Slack incoming event error: %+v", ev.Error())

case *slack.UnmarshallingErrorEvent:
logging.Logger.Errorf("Slack unmarshalling error: %+v", ev.Error())

case *slack.InvalidAuthEvent:
logging.Logger.Error("Invalid Credentials")
return

default:
}
}
Expand Down

0 comments on commit 40031d4

Please sign in to comment.