Add external URL for chat and private channel messages. Fixes #308

This commit is contained in:
Tulir Asokan
2019-05-11 20:08:48 +03:00
parent c50fd4b3ac
commit b9a0e6cbb6
+2
View File
@@ -1311,6 +1311,8 @@ class Portal:
def get_external_url(self, evt: Message) -> Optional[str]:
if self.peer_type == "channel" and self.username is not None:
return f"https://t.me/{self.username}/{evt.id}"
elif self.peer_type != "user":
return f"https://t.me/c/{self.tgid}/{evt.id}"
return None
async def handle_telegram_photo(self, source: 'AbstractUser', intent: IntentAPI, evt: Message,