mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Add ExportedFolderLink types
Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
parent
a3fdc44a56
commit
f631f62985
4 changed files with 59 additions and 1 deletions
|
|
@ -518,6 +518,7 @@ def pyrogram_api():
|
|||
Folder
|
||||
Restriction
|
||||
EmojiStatus
|
||||
ExportedFolderLink
|
||||
ForumTopic
|
||||
PeerUser
|
||||
PeerChannel
|
||||
|
|
|
|||
|
|
@ -67,4 +67,4 @@ class ExportFolderLink:
|
|||
)
|
||||
)
|
||||
|
||||
return r.invite.url
|
||||
return types.ExportedFolderLink._parse(r)
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ from .chat_privileges import ChatPrivileges
|
|||
from .chat_reactions import ChatReactions
|
||||
from .dialog import Dialog
|
||||
from .emoji_status import EmojiStatus
|
||||
from .exported_folder_link import ExportedFolderLink
|
||||
from .folder import Folder
|
||||
from .group_call_member import GroupCallMember
|
||||
from .invite_link_importer import InviteLinkImporter
|
||||
|
|
@ -107,6 +108,7 @@ __all__ = [
|
|||
"ChatPrivileges",
|
||||
"ChatJoiner",
|
||||
"EmojiStatus",
|
||||
"ExportedFolderLink",
|
||||
"GroupCallMember",
|
||||
"ChatReactions"
|
||||
]
|
||||
|
|
|
|||
55
pyrogram/types/user_and_chats/exported_folder_link.py
Normal file
55
pyrogram/types/user_and_chats/exported_folder_link.py
Normal 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)
|
||||
)
|
||||
Loading…
Reference in a new issue