парсер
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user