2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 13:27:47 +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 datetime import datetime
from typing import Dict from typing import Dict
from typing import Optional
import pyrogram import pyrogram
from pyrogram import raw, utils from pyrogram import raw, utils
@ -103,7 +104,10 @@ class ChatInviteLink(Object):
client: "pyrogram.Client", client: "pyrogram.Client",
invite: "raw.base.ExportedChatInvite", invite: "raw.base.ExportedChatInvite",
users: Dict[int, "raw.types.User"] = None users: Dict[int, "raw.types.User"] = None
) -> "ChatInviteLink": ) -> Optional["ChatInviteLink"]:
if not isinstance(invite, raw.types.ChatInviteExported):
return None
creator = ( creator = (
types.User._parse(client, users[invite.admin_id]) types.User._parse(client, users[invite.admin_id])
if users is not None if users is not None