pyrofork: Add ExportedFolderLink types

Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
wulan17 2025-12-10 22:55:36 +07:00
parent a3fdc44a56
commit f631f62985
No known key found for this signature in database
GPG key ID: 737814D4B5FF0420
4 changed files with 59 additions and 1 deletions

View file

@ -518,6 +518,7 @@ def pyrogram_api():
Folder Folder
Restriction Restriction
EmojiStatus EmojiStatus
ExportedFolderLink
ForumTopic ForumTopic
PeerUser PeerUser
PeerChannel PeerChannel

View file

@ -67,4 +67,4 @@ class ExportFolderLink:
) )
) )
return r.invite.url return types.ExportedFolderLink._parse(r)

View file

@ -42,6 +42,7 @@ from .chat_privileges import ChatPrivileges
from .chat_reactions import ChatReactions from .chat_reactions import ChatReactions
from .dialog import Dialog from .dialog import Dialog
from .emoji_status import EmojiStatus from .emoji_status import EmojiStatus
from .exported_folder_link import ExportedFolderLink
from .folder import Folder from .folder import Folder
from .group_call_member import GroupCallMember from .group_call_member import GroupCallMember
from .invite_link_importer import InviteLinkImporter from .invite_link_importer import InviteLinkImporter
@ -107,6 +108,7 @@ __all__ = [
"ChatPrivileges", "ChatPrivileges",
"ChatJoiner", "ChatJoiner",
"EmojiStatus", "EmojiStatus",
"ExportedFolderLink",
"GroupCallMember", "GroupCallMember",
"ChatReactions" "ChatReactions"
] ]

View file

@ -0,0 +1,55 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from typing import List, Union
import pyrogram
from pyrogram import enums
from pyrogram import raw
from pyrogram import types
from pyrogram import utils
from ..object import Object
class ExportedFolderLink(Object):
"""Describes an exported chat folder link.
Parameters:
link (``str``):
The link itself.
title (``str``, *optional*):
Title of the folder.
"""
def __init__(
self,
link: str,
title: str = None
):
super().__init__(None)
self.link = link
self.title = title
@staticmethod
def _parse(exported_folder_link: "raw.base.ExportedChatFolderLink") -> "ExportedFolderLink":
return ExportedFolderLink(
link=getattr(exported_folder_link, "link", None),
title=getattr(exported_folder_link, "title", None)
)