Arman92 / go-tdlib

Golang Telegram TdLib JSON bindings
GNU General Public License v3.0
435 stars 101 forks source link

can't get SenderUserID #61

Open tretm opened 3 years ago

tretm commented 3 years ago

I updated the tdlib and it lacks in the message type two fields SenderUserID and SenderChatID instead of this there is a Sender field how can I get the SenderUserID in the message filtering function?

er-azh commented 3 years ago

this should work:

// msg is a *tdlib.Message
if msg.Sender.GetMessageSenderEnum() == msg.MessageSenderUserType{
        fmt.Printf("sender id: %d\n", reply.Sender.(*tdlib.MessageSenderUser).UserID)
}