fix delay
This commit is contained in:
parent
43ef0a50fc
commit
eb7326d96b
2
def.go
2
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 {
|
||||
|
4
td.go
4
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user