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

@@ -56,17 +56,18 @@ func (t *Telegram) ParseChannelMetaByInvite(ctx context.Context, inviteLink stri
}
username := ""
if usernameVal, ok := channel.GetUsername(); ok {
if usernameVal, ok := channel.GetUsername(); ok && usernameVal != "" {
username = usernameVal
}
return domain.Channel{
ID: uuid.New(),
TelegramID: domain.ChatIDFromChannelID(channel.ID),
Username: username,
Title: channel.Title,
AccessHash: channel.AccessHash,
Pts: pts,
ID: uuid.New(),
TelegramID: domain.ChatIDFromChannelID(channel.ID),
Username: username,
Title: channel.Title,
AccessHash: channel.AccessHash,
Pts: pts,
IsAccessible: true,
}, nil
}