diff --git a/main.go b/main.go index f8af0fe..01ee1dd 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,6 @@ package main import ( - "encoding/json" "flag" "fmt" "log" @@ -10,7 +9,6 @@ import ( "gopkg.in/gcfg.v1" "github.com/Arman92/go-tdlib" - "github.com/streadway/amqp" ) type MsgDirection string diff --git a/td.go b/td.go index 9720152..08dad97 100644 --- a/td.go +++ b/td.go @@ -2,13 +2,11 @@ package main import ( "encoding/json" - "flag" "fmt" "log" + "math" "time" - "gopkg.in/gcfg.v1" - "github.com/Arman92/go-tdlib" "github.com/streadway/amqp" ) @@ -142,7 +140,7 @@ func getHistory(c *tdlib.Client) { logOnError(err, "Cannot get history") lastMsgID64 = -1 } else { - for msg := range msgs.Messages { + for _, msg := range msgs.Messages { m := ChatWarsMessage{ UserID64: int64(msg.SenderUserID),