приватные каналы
This commit is contained in:
@@ -27,6 +27,15 @@ class Post(TimestampedModel):
|
||||
|
||||
@property
|
||||
def url(self) -> str | None:
|
||||
if not self.channel.username:
|
||||
if self.channel.username:
|
||||
return f'https://t.me/{self.channel.username}/{self.message_id}'
|
||||
|
||||
telegram_id = self.channel.telegram_id
|
||||
if telegram_id is None:
|
||||
return None
|
||||
return f'https://t.me/{self.channel.username}/{self.message_id}'
|
||||
|
||||
channel_id = telegram_id
|
||||
if telegram_id < 0:
|
||||
channel_id = -telegram_id - 1000000000000
|
||||
|
||||
return f'https://t.me/c/{channel_id}/{self.message_id}'
|
||||
|
||||
Reference in New Issue
Block a user