Skip to content

Commit

Permalink
Add the message TTL field
Browse files Browse the repository at this point in the history
  • Loading branch information
farcaller authored and gregdel committed Sep 7, 2023
1 parent 9981463 commit 2167785
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type Message struct {
Sound string
HTML bool
Monospace bool
TTL time.Duration

// attachment
attachment io.Reader
Expand Down Expand Up @@ -166,6 +167,10 @@ func (m *Message) toMap(pToken, rToken string) map[string]string {
}
}

if m.TTL != 0 {
ret["ttl"] = strconv.FormatFloat(m.TTL.Seconds(), 'f', -1, 64)
}

return ret
}

Expand Down

0 comments on commit 2167785

Please sign in to comment.