From 1914f82276720c5c579903dce791d6132ead21ce Mon Sep 17 00:00:00 2001 From: shoopea Date: Thu, 12 Dec 2019 10:46:42 +0800 Subject: [PATCH] fix var --- td.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/td.go b/td.go index 8b8d237..8962459 100644 --- a/td.go +++ b/td.go @@ -32,7 +32,7 @@ func ListenMe(c *tdlib.Client) { func ListenMQ(c *tdlib.Client, msgs <-chan TGCommand) { for m := range msgs { - b, _ := json.Marshal(m) + //b, _ := json.Marshal(m) //log.Printf("****************************** New MQ command ******************************\n%s\n****************************************************************************\n", string(b)) go clientMsg(c, m) } @@ -118,12 +118,11 @@ func ListenTest(c *tdlib.Client) { chatID := int64(updateMsg.Message.ChatID) userID := int64(updateMsg.Message.SenderUserID) forwardInfo := updateMsg.Message.ForwardInfo - for _, v := range cfg.Listen { - if chatID == 408101137 && userID == 408101137 && forwardInfo == nil { - return true - } + if chatID == 408101137 && userID == 408101137 && forwardInfo == nil { + return true + } else { + return false } - return false } receiver := c.AddEventReceiver(&tdlib.UpdateNewMessage{}, eventFilter, 100)