Skip to content

Commit

Permalink
Update golang v1.13, fix bug with call duty already from thread
Browse files Browse the repository at this point in the history
  • Loading branch information
insidieux committed Nov 28, 2019
1 parent 6b0ea2c commit fa3ab0d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif

override APP_NAME=slack-duty-bot
override MOD_NAME=github.com/insidieux/${APP_NAME}
override GO_VERSION=1.12
override GO_VERSION=1.13
override CGO_ENABLED=0

# build go binary variables
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/kr/pty v1.1.8 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/nlopes/slack v0.6.0
github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249
github.com/pelletier/go-toml v1.4.0 // indirect
github.com/prometheus/client_golang v1.1.0 // indirect
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect
Expand Down Expand Up @@ -50,3 +50,5 @@ require (
google.golang.org/grpc v1.23.1 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)

go 1.13
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ github.com/nlopes/slack v0.2.0 h1:ygNVH3HWrOPFbzFoAmRKPcMcmYMmsLf+vPV9DhJdqJI=
github.com/nlopes/slack v0.2.0/go.mod h1:jVI4BBK3lSktibKahxBF74txcK2vyvkza1z/+rRnVAM=
github.com/nlopes/slack v0.6.0 h1:jt0jxVQGhssx1Ib7naAOZEZcGdtIhTzkP0nopK0AsRA=
github.com/nlopes/slack v0.6.0/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/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pelletier/go-toml v1.1.0 h1:cmiOvKzEunMsAxyhXSzpL5Q1CRKpVv0KQsnAIcSEVYM=
Expand Down
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,14 @@ func handleMessageEvent(rtm *slack.RTM, event *slack.MessageEvent) error {
//send message
var rtmOptions = make([]slack.RTMsgOption, 0)
if viper.GetBool("slack.threads") == true {
rtmOptions = append(rtmOptions, slack.RTMsgOptionTS(event.Timestamp))
var (
optionTS = event.Timestamp
)
// message already in timestamp
if event.ThreadTimestamp != `` {
optionTS = event.ThreadTimestamp
}
rtmOptions = append(rtmOptions, slack.RTMsgOptionTS(optionTS))
}
var outgoingMessage = rtm.NewOutgoingMessage(strings.Join(duties, ", "), event.Channel, rtmOptions...)
logrus.Debugf("Outgoing message: %+v", outgoingMessage)
Expand Down

0 comments on commit fa3ab0d

Please sign in to comment.