парсер

This commit is contained in:
Artem Tsyrulnikov
2026-01-06 22:15:49 +03:00
parent 2c0ae2dfc3
commit a8be39005b
10 changed files with 237 additions and 17 deletions

View File

@@ -2,6 +2,7 @@ package bot
import (
"context"
"encoding/json"
"fmt"
"strings"
"sync"
@@ -222,6 +223,11 @@ func (b *Bot) Update(u *echotron.Update) {
if u.ChatJoinRequest != nil || u.ChatMember != nil || u.MyChatMember != nil {
go func() {
ctx := context.Background()
if raw, err := json.Marshal(u); err == nil {
log.Info().RawJSON("update", raw).Msg("System event payload")
} else {
log.Error().Err(err).Msg("Failed to marshal system event payload")
}
err := b.Backend.ForwardTelegramUpdate(ctx, u)
if err != nil {
log.Error().Err(err).Msg("Failed to forward system event to backend")

View File

@@ -1433,6 +1433,7 @@ func (s *PurchaseOptionalDetails) sendCreativeWithInviteLink(
creative *backend.Creative,
inviteLink string,
) {
log.Info().Str("invite_link", inviteLink).Msg("Sending creative with invite link")
linkedText := s.injectInviteLink(creative.Text, inviteLink)
editor := CreativeEditorFields{
Text: &linkedText,