This commit is contained in:
shoopea 2019-05-04 18:37:43 +08:00
parent 046d47bc52
commit 71ee2eb14b

7
td.go
View File

@ -93,7 +93,6 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) {
lastMsgID64 = -1 lastMsgID64 = -1
} }
} else if msgs.TotalCount > 0 { } else if msgs.TotalCount > 0 {
fmt.Printf("Exported %d messages so far.\n", msgCount)
for _, msg := range msgs.Messages { for _, msg := range msgs.Messages {
switch msg.Content.GetMessageContentEnum() { switch msg.Content.GetMessageContentEnum() {
case tdlib.MessageTextType: case tdlib.MessageTextType:
@ -105,15 +104,13 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) {
ChatID64: msg.ChatID, ChatID64: msg.ChatID,
Text: msg.Content.(*tdlib.MessageText).Text.Text, Text: msg.Content.(*tdlib.MessageText).Text.Text,
} }
fmt.Printf("straight msg id : %d\n", m.ID64)
} else { } else {
if msg.ForwardInfo.GetMessageForwardInfoEnum() == tdlib.MessageForwardedFromUserType { if msg.ForwardInfo.GetMessageForwardInfoEnum() == tdlib.MessageForwardedFromUserType {
fmt.Printf("forwarded msg date : %d\n", msg.ForwardInfo.(*tdlib.MessageForwardedFromUser).Date)
m = ChatWarsMessage{ m = ChatWarsMessage{
SenderUserID64: int64(msg.ForwardInfo.(*tdlib.MessageForwardedFromUser).SenderUserID), SenderUserID64: int64(msg.ForwardInfo.(*tdlib.MessageForwardedFromUser).SenderUserID),
Date: msg.ForwardInfo.(*tdlib.MessageForwardedFromUser).Date, Date: msg.ForwardInfo.(*tdlib.MessageForwardedFromUser).Date,
ID64: msg.ForwardInfo.(*tdlib.MessageForwardedFromUser).ForwardedFromMessageID, ID64: msg.ID,
ChatID64: msg.ForwardInfo.(*tdlib.MessageForwardedFromUser).ForwardedFromChatID, ChatID64: 0,
Text: msg.Content.(*tdlib.MessageText).Text.Text, Text: msg.Content.(*tdlib.MessageText).Text.Text,
} }
} else { } else {