go-tdlib icon indicating copy to clipboard operation
go-tdlib copied to clipboard

can't get SenderUserID

Open tretm opened this issue 4 years ago • 1 comments

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?

tretm avatar Dec 24 '20 07:12 tretm

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)
}

er-azh avatar Apr 15 '21 21:04 er-azh