fix парсер

This commit is contained in:
Artem Tsyrulnikov
2026-01-28 18:29:56 +03:00
parent 5910cf48dc
commit f23f489b22
7 changed files with 87 additions and 61 deletions

View File

@@ -96,7 +96,7 @@ func extractChannelMeta(currentChannel domain.Channel, chats []tg.ChatClass) *do
}
username := ""
if usernameVal, ok := ch.GetUsername(); ok {
if usernameVal, ok := ch.GetUsername(); ok && usernameVal != "" {
username = usernameVal
}
@@ -107,12 +107,13 @@ func extractChannelMeta(currentChannel domain.Channel, chats []tg.ChatClass) *do
}
updated := domain.Channel{
ID: currentChannel.ID,
TelegramID: domain.ChatIDFromChannelID(ch.ID),
Username: username,
Title: ch.Title,
AccessHash: accessHash,
Pts: currentChannel.Pts,
ID: currentChannel.ID,
TelegramID: domain.ChatIDFromChannelID(ch.ID),
Username: username,
Title: ch.Title,
AccessHash: accessHash,
Pts: currentChannel.Pts,
IsAccessible: currentChannel.IsAccessible,
}
return &updated