Skip to content

Commit 8013b57

Browse files
authored
BugFixes with Join Chat Link
1 parent 637fb3b commit 8013b57

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

pyrogram/methods/chats/join_chat.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,17 @@ async def join_chat(
6565
elif isinstance(chat.chats[0], raw.types.Channel):
6666
return types.Chat._parse_channel_chat(self, chat.chats[0])
6767
else:
68-
chat = await self.invoke(
69-
raw.functions.channels.JoinChannel(
70-
channel=await self.resolve_peer(chat_id.split('/')[-1])
68+
try:
69+
chat = await self.invoke(
70+
raw.functions.channels.JoinChannel(
71+
channel=await self.resolve_peer(chat_id.split('/')[-1])
72+
)
73+
)
74+
except AttributeError:
75+
chat = await self.invoke(
76+
raw.functions.channels.JoinChannel(
77+
channel=await self.resolve_peer(chat_id)
78+
)
7179
)
72-
)
7380

7481
return types.Chat._parse_channel_chat(self, chat.chats[0])

0 commit comments

Comments
 (0)