We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78fe290 commit 9aefff9Copy full SHA for 9aefff9
1 file changed
pyrogram/types/user_and_chats/chat_invite_link.py
@@ -18,6 +18,7 @@
18
19
from datetime import datetime
20
from typing import Dict
21
+from typing import Optional
22
23
import pyrogram
24
from pyrogram import raw, utils
@@ -103,7 +104,10 @@ def _parse(
103
104
client: "pyrogram.Client",
105
invite: "raw.base.ExportedChatInvite",
106
users: Dict[int, "raw.types.User"] = None
- ) -> "ChatInviteLink":
107
+ ) -> Optional["ChatInviteLink"]:
108
+ if not isinstance(invite, raw.types.ChatInviteExported):
109
+ return None
110
+
111
creator = (
112
types.User._parse(client, users[invite.admin_id])
113
if users is not None
0 commit comments