время в топе и тэги креативов
This commit is contained in:
@@ -3,6 +3,7 @@ package telegram
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
"github.com/gotd/td/tg"
|
||||
@@ -60,7 +61,8 @@ func extractPosts(channel domain.Channel, msgs []tg.MessageClass) []domain.Post
|
||||
}
|
||||
|
||||
text := messageToHTML(m.Message, m.Entities)
|
||||
p := domain.NewPost(channel, m.ID, text, m.Views)
|
||||
publishedAt := time.Unix(int64(m.Date), 0).UTC()
|
||||
p := domain.NewPost(channel, m.ID, text, m.Views, publishedAt)
|
||||
posts = append(posts, p)
|
||||
}
|
||||
|
||||
@@ -73,7 +75,7 @@ func extractDeletedPosts(channel domain.Channel, updates []tg.UpdateClass) []dom
|
||||
for _, upd := range updates {
|
||||
if u, ok := upd.(*tg.UpdateDeleteChannelMessages); ok {
|
||||
for _, msgID := range u.Messages {
|
||||
p := domain.NewPost(channel, msgID, "", 0)
|
||||
p := domain.NewPost(channel, msgID, "", 0, time.Time{})
|
||||
deleted = append(deleted, p)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package telegram
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
"github.com/gotd/td/tg"
|
||||
@@ -39,7 +40,8 @@ func (t *Telegram) GetChannelHistory(ctx context.Context, channel domain.Channel
|
||||
}
|
||||
|
||||
text := messageToHTML(m.Message, m.Entities)
|
||||
p := domain.NewPost(channel, m.ID, text, m.Views)
|
||||
publishedAt := time.Unix(int64(m.Date), 0).UTC()
|
||||
p := domain.NewPost(channel, m.ID, text, m.Views, publishedAt)
|
||||
placements = append(placements, p)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user