This commit is contained in:
shoopea 2019-04-29 13:59:56 +08:00
parent 7fd7daba13
commit 15859aeb18

13
main.go
View File

@ -98,11 +98,9 @@ func main() {
} }
func ListenCW(c *tdlib.Client) { func ListenCW(c *tdlib.Client) {
var msgDisplay, msgDelete bool
eventFilter := func(msg *tdlib.TdMessage) bool { eventFilter := func(msg *tdlib.TdMessage) bool {
updateMsg := (*msg).(*tdlib.UpdateNewMessage) updateMsg := (*msg).(*tdlib.UpdateNewMessage)
chatID := updateMsg.Message.ChatID chatID := updateMsg.Message.ChatID
senderUserID := updateMsg.Message.SenderUserID
if (chatID == user_chtwrsbot) { if (chatID == user_chtwrsbot) {
return true return true
} }
@ -150,17 +148,6 @@ func ListenCW(c *tdlib.Client) {
m.Direction = Incoming m.Direction = Incoming
} }
username := "null"
if senderUserID != 0 {
user, err := c.GetUser(senderUserID)
if err != nil {
fmt.Println("Listen:", err.Error())
continue
} else {
}
}
b, err := json.Marshal(m) b, err := json.Marshal(m)
_ = ch.Publish( _ = ch.Publish(