Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update slack dep to work with latest Slack api changes #217

Merged
merged 1 commit into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go

go:
- '1.12'
- '1.13'

services:
- docker
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
18 changes: 17 additions & 1 deletion pkg/bot/slack.go
Original file line number Diff line number Diff line change
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,25 @@ func (b *SlackBot) Start() {
case *slack.RTMError:
logging.Logger.Errorf("Slack RMT error: %+v", ev.Error())

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

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

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

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

case *slack.RateLimitedError:
logging.Logger.Errorf("Slack rate limiting error: %+v", ev.Error())

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

default:
}
}
Expand Down