Skip to content

Commit a9cef9a

Browse files
authored
Merge pull request #56 from aln730/master
include username and location in knockEvent messages
2 parents e2a82b4 + 4f03b91 commit a9cef9a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

site/slack.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,19 @@ func (bot SlackBot) sendKnock(username string, location string) (messagets strin
8686

8787
}
8888

89-
func (bot SlackBot) updateStatus(knockEvent KnockEvent) {
89+
func (bot SlackBot) updateStatus(knockEvent KnockEvent, username string, location string) {
9090
// Allows messages to be updated with the status of the request
9191
if !bot.isValidBot {
9292
return
9393
}
9494

9595
text := ""
9696
if knockEvent.Event == "ACKNOWLEDGE" {
97-
text = "This request was answered 🟢!"
97+
text = fmt.Sprintf("This request was answered 🟢!\nUser: %s\nLocation: %s", username, location)
9898
} else if knockEvent.Event == "NEVERMIND" {
99-
text = "This request was cancelled 🟡!"
99+
text = fmt.Sprintf("This request was cancelled 🟡!\nUser: %s\nLocation: %s", username, location)
100100
} else if knockEvent.Event == "TIMEOUT" {
101-
text = "This request timed out 🔴!"
101+
text = fmt.Sprintf("This request timed out 🔴!\nUser: %s\nLocation: %s", username, location)
102102
}
103103

104104
_, channelID, timestamp, err := bot.api.UpdateMessage(

0 commit comments

Comments
 (0)