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 1/2] 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 From 4493f781389df58dd046f8b73812cbacf33383f6 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 3 Jan 2019 08:59:39 +0100 Subject: [PATCH 2/2] Update to v0.10.3 --- docs/source/start/Installation.rst | 2 +- pyrogram/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/start/Installation.rst b/docs/source/start/Installation.rst index 3769b9f9..78adf6ae 100644 --- a/docs/source/start/Installation.rst +++ b/docs/source/start/Installation.rst @@ -82,7 +82,7 @@ If no error shows up you are good to go. >>> import pyrogram >>> pyrogram.__version__ - '0.10.2' + '0.10.3' .. _TgCrypto: https://docs.pyrogram.ml/resources/TgCrypto .. _develop: http://github.com/pyrogram/pyrogram diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index bb67afce..abeb8b43 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -23,7 +23,7 @@ __copyright__ = "Copyright (C) 2017-2018 Dan Tès