diff --git a/td.go b/td.go index dade51e..d32f1e1 100644 --- a/td.go +++ b/td.go @@ -109,6 +109,7 @@ func ListenCW(c *tdlib.Client) { func getHistory(c *tdlib.Client) { var lastMsgID64 int64 = int64(math.MaxInt64) + var msgCount int32 = 0 conn, err := amqp.Dial("amqp://" + cfg.Rabbit.User + ":" + cfg.Rabbit.Password + "@" + cfg.Rabbit.Host + "/" + cfg.Rabbit.Queue) if err != nil { @@ -169,12 +170,14 @@ func getHistory(c *tdlib.Client) { if msg.ID < lastMsgID64 { lastMsgID64 = msg.ID } + msgCount = msgCount + 1 default: log.Printf("getHistory : no handler for %s\n", msg.Content) } } } } + log.Printf("Exported %d messages.\n", msgCount) } func ForwardMsg(c *tdlib.Client, msgID int64, fromChatID int64, toChatID int64) int64 {