diff --git a/main.go b/main.go index d66586e..b804681 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,7 @@ import ( ) type ChatWarsMessage struct { + UserID64 int64 `json:"user_id"` SenderUserID64 int64 `json:"sender_user_id"` Date int32 `json:"date"` ID64 int64 `json:"id"` diff --git a/td.go b/td.go index 0a5b2b6..8582d7f 100644 --- a/td.go +++ b/td.go @@ -35,6 +35,7 @@ func ListenCW(c *tdlib.Client) { t := time.Now() m := ChatWarsMessage{ + UserID64: ownUserID64, SenderUserID64: int64(updateMsg.Message.SenderUserID), Date: updateMsg.Message.Date, ID64: updateMsg.Message.ID, @@ -112,6 +113,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { case tdlib.MessageTextType: if msg.ForwardInfo == nil { m = ChatWarsMessage{ + UserID64: ownUserID64, SenderUserID64: int64(msg.SenderUserID), Date: msg.Date, ID64: msg.ID, @@ -121,6 +123,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { } else { if msg.ForwardInfo.GetMessageForwardInfoEnum() == tdlib.MessageForwardedFromUserType { m = ChatWarsMessage{ + UserID64: int64(msg.SenderUserID), SenderUserID64: int64(msg.ForwardInfo.(*tdlib.MessageForwardedFromUser).SenderUserID), Date: msg.ForwardInfo.(*tdlib.MessageForwardedFromUser).Date, ID64: msg.ID,