ручное парсер
This commit is contained in:
@@ -31,7 +31,7 @@ func (t *Telegram) GetChannelHistory(ctx context.Context, channel domain.Channel
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
placements := make([]domain.Post, 0, len(messages.Messages))
|
||||
posts := make([]domain.Post, 0, len(messages.Messages))
|
||||
|
||||
for _, raw := range messages.Messages {
|
||||
m, ok := raw.(*tg.Message)
|
||||
@@ -42,8 +42,8 @@ func (t *Telegram) GetChannelHistory(ctx context.Context, channel domain.Channel
|
||||
text := messageToHTML(m.Message, m.Entities)
|
||||
publishedAt := time.Unix(int64(m.Date), 0).UTC()
|
||||
p := domain.NewPost(channel, m.ID, text, m.Views, publishedAt)
|
||||
placements = append(placements, p)
|
||||
posts = append(posts, p)
|
||||
}
|
||||
|
||||
return placements, nil
|
||||
return posts, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user