diff --git a/def.go b/def.go index 387a997..8217124 100644 --- a/def.go +++ b/def.go @@ -16,7 +16,7 @@ type TGCommand struct { Text string `json:"text"` Document tb.Document `json:"document"` ParseMode int64 `json:"parse_mode"` - Delay int64 `json:"delay"` + Delay time.Delay `json:"delay"` } type ChatWarsMessage struct { diff --git a/td.go b/td.go index 2ea6a8a..2c61769 100644 --- a/td.go +++ b/td.go @@ -219,8 +219,8 @@ func OwnUserID(c *tdlib.Client) int32 { } func clientMsg(c *tdlib.Client, m TGCommand) { - log.Printf("clientMsg : Delaying message by %d seconds.\n", m.Delay) - if m.Delay != 0 { + log.Printf("clientMsg : Delaying message by %d seconds.\n", int64(m.Delay)) + if m.Delay != time.Duration(0) { time.Sleep(time.Duration(m.Delay) * time.Second) } for {