Skip to content

Commit

Permalink
Mark 'recently sent' on response from slack
Browse files Browse the repository at this point in the history
We run into a weird situation where:

1. Recipient (R) sends a message to the bot at 1200 (for example)
2. Advisor (A) sends a resonse to the bot at 1231
3. R sends a message back at 1232
4. Bot (B) sends a thank you message

In this situation R and A are in an active conversation, yet B sends a response as if R has just initiated a response. This is because as far as B is concerned, it has been over 30 minutes since the last message.

In this situation, then, we reset the 'Thank you' response on all responses; whether from R or A. This removes the absurdity
  • Loading branch information
jspc committed Sep 25, 2022
1 parent 80d723c commit 2732cc8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ func (c Client) HandleResponse(msg Message) (err error) {
Conversation: stringRef(msg.Message),
})

c.r.MarkRecentlySent(thankyouKey(msg.ID), time.Minute*30)

return
}

Expand Down

0 comments on commit 2732cc8

Please sign in to comment.