Make invite links of public channels work with get_chat

This commit is contained in:
Dan 2019-01-02 22:39:16 +01:00
parent 1f8f313398
commit 372bbabe28
2 changed files with 5 additions and 0 deletions

View File

@ -103,6 +103,9 @@ class BaseClient:
def resolve_peer(self, peer_id: int or str): def resolve_peer(self, peer_id: int or str):
pass pass
def fetch_peers(self, entities):
pass
def add_handler(self, handler, group: int = 0) -> tuple: def add_handler(self, handler, group: int = 0) -> tuple:
pass pass

View File

@ -56,6 +56,8 @@ class GetChat(BaseClient):
if isinstance(r, types.ChatInvite): if isinstance(r, types.ChatInvite):
raise ValueError("You haven't joined \"t.me/joinchat/{}\" yet".format(h)) raise ValueError("You haven't joined \"t.me/joinchat/{}\" yet".format(h))
self.fetch_peers([r.chat])
if isinstance(r.chat, types.Chat): if isinstance(r.chat, types.Chat):
chat_id = -r.chat.id chat_id = -r.chat.id