приватные каналы

This commit is contained in:
Artem Tsyrulnikov
2026-01-21 02:41:20 +03:00
parent 233afb5451
commit b5695360c2
27 changed files with 1026 additions and 217 deletions

View File

@@ -79,20 +79,9 @@ async def create_placements(
creatives_by_id: dict[uuid.UUID, domain.Creative] = {}
for channel_input in input.channels:
channel = await self.database.get_channel(username=channel_input.username)
channel = await self.database.get_channel(channel_id=channel_input.channel_id)
if not channel:
parser_response = await self.parser.fetch_telegram_channel(channel_input.username)
if not parser_response:
raise domain.TelegramChannelNotFound(channel_input.username)
channel = domain.Channel(
username=parser_response.username,
telegram_id=parser_response.telegram_id,
title=parser_response.title,
)
await self.database.create_channel(channel)
log.info('Created channel @%s with telegram_id=%s', channel.username, channel.telegram_id)
raise domain.ChannelNotFound(channel_input.channel_id)
# Объединяем общие детали с деталями конкретного канала
channel_details = channel_input.details