From 372bbabe285c7a03209523c31fa971f285e7b66f Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 2 Jan 2019 22:39:16 +0100 Subject: [PATCH] Make invite links of public channels work with get_chat --- pyrogram/client/ext/base_client.py | 3 +++ pyrogram/client/methods/chats/get_chat.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/pyrogram/client/ext/base_client.py b/pyrogram/client/ext/base_client.py index 24a621de..7aee5302 100644 --- a/pyrogram/client/ext/base_client.py +++ b/pyrogram/client/ext/base_client.py @@ -103,6 +103,9 @@ class BaseClient: def resolve_peer(self, peer_id: int or str): pass + def fetch_peers(self, entities): + pass + def add_handler(self, handler, group: int = 0) -> tuple: pass diff --git a/pyrogram/client/methods/chats/get_chat.py b/pyrogram/client/methods/chats/get_chat.py index 188c39e5..d30fd9bb 100644 --- a/pyrogram/client/methods/chats/get_chat.py +++ b/pyrogram/client/methods/chats/get_chat.py @@ -56,6 +56,8 @@ class GetChat(BaseClient): if isinstance(r, types.ChatInvite): raise ValueError("You haven't joined \"t.me/joinchat/{}\" yet".format(h)) + self.fetch_peers([r.chat]) + if isinstance(r.chat, types.Chat): chat_id = -r.chat.id