приватные каналы
This commit is contained in:
@@ -18,6 +18,7 @@ func (d *Database) GetTrackedPosts(ctx context.Context, channel domain.Channel)
|
||||
p.text,
|
||||
CASE
|
||||
WHEN c.username IS NOT NULL THEN CONCAT('https://t.me/', c.username, '/', p.message_id)
|
||||
WHEN c.telegram_id IS NOT NULL THEN CONCAT('https://t.me/c/', (-c.telegram_id - 1000000000000), '/', p.message_id)
|
||||
ELSE ''
|
||||
END as link,
|
||||
COALESCE(
|
||||
|
||||
@@ -19,6 +19,8 @@ func NewPost(channel Channel, messageID int, text string, views int) Post {
|
||||
link := ""
|
||||
if channel.Username != "" {
|
||||
link = fmt.Sprintf("https://t.me/%s/%d", channel.Username, messageID)
|
||||
} else if channel.TelegramID != 0 {
|
||||
link = fmt.Sprintf("https://t.me/c/%d/%d", ChannelIDFromChatID(channel.TelegramID), messageID)
|
||||
}
|
||||
return Post{
|
||||
ID: uuid.New(),
|
||||
|
||||
Reference in New Issue
Block a user