diff --git a/Makefile b/Makefile index 74bb00e..e73e638 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/go.mod b/go.mod index 796c528..0c93352 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/go.sum b/go.sum index 0a89da0..6799778 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/main.go b/main.go index 91f6432..df0e2b5 100644 --- a/main.go +++ b/main.go @@ -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)