fix delay

This commit is contained in:
shoopea 2019-08-24 14:07:35 +08:00
parent beee1818b1
commit 2114ec7be5

4
td.go
View File

@ -219,9 +219,9 @@ func OwnUserID(c *tdlib.Client) int32 {
}
func clientMsg(c *tdlib.Client, m TGCommand) {
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)
log.Printf("clientMsg : Delaying message by %d seconds.\n", int64(m.Delay))
time.Sleep(m.Delay)
}
for {
lastOwnTDMsgMux.Lock()