2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Fix join applications for public chats

This commit is contained in:
Dan 2022-08-12 18:20:05 +02:00
parent 78fe290b40
commit 9aefff9f8d

View File

@ -18,6 +18,7 @@
from datetime import datetime
from typing import Dict
from typing import Optional
import pyrogram
from pyrogram import raw, utils
@ -103,7 +104,10 @@ class ChatInviteLink(Object):
client: "pyrogram.Client",
invite: "raw.base.ExportedChatInvite",
users: Dict[int, "raw.types.User"] = None
) -> "ChatInviteLink":
) -> Optional["ChatInviteLink"]:
if not isinstance(invite, raw.types.ChatInviteExported):
return None
creator = (
types.User._parse(client, users[invite.admin_id])
if users is not None