Skip to content

Commit 2167785

Browse files
farcallergregdel
authored andcommitted
Add the message TTL field
1 parent 9981463 commit 2167785

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

message.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type Message struct {
3737
Sound string
3838
HTML bool
3939
Monospace bool
40+
TTL time.Duration
4041

4142
// attachment
4243
attachment io.Reader
@@ -166,6 +167,10 @@ func (m *Message) toMap(pToken, rToken string) map[string]string {
166167
}
167168
}
168169

170+
if m.TTL != 0 {
171+
ret["ttl"] = strconv.FormatFloat(m.TTL.Seconds(), 'f', -1, 64)
172+
}
173+
169174
return ret
170175
}
171176

0 commit comments

Comments
 (0)