File tree Expand file tree Collapse file tree 4 files changed +51
-1
lines changed
pyrogram/types/user_and_chats Expand file tree Collapse file tree 4 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -552,6 +552,7 @@ def get_title_list(s: str) -> list:
552552 ForumTopicCreated
553553 ForumTopicEdited
554554 ForumTopicClosed
555+ ForumTopicDeleted
555556 ForumTopicReopened
556557 GeneralTopicHidden
557558 GeneralTopicUnhidden
Original file line number Diff line number Diff line change 5050from .forum_topic import ForumTopic
5151from .forum_topic_created import ForumTopicCreated
5252from .forum_topic_closed import ForumTopicClosed
53+ from .forum_topic_deleted import ForumTopicDeleted
5354from .forum_topic_reopened import ForumTopicReopened
5455from .forum_topic_edited import ForumTopicEdited
5556from .general_forum_topic_hidden import GeneralTopicHidden
8889 "ForumTopic" ,
8990 "ForumTopicCreated" ,
9091 "ForumTopicClosed" ,
92+ "ForumTopicDeleted" ,
9193 "ForumTopicReopened" ,
9294 "ForumTopicEdited" ,
9395 "GeneralTopicHidden" ,
Original file line number Diff line number Diff line change @@ -123,7 +123,9 @@ def __init__(
123123 #self.draft = draft //todo
124124
125125 @staticmethod
126- def _parse (forum_topic : "raw.types.forum_topic" ) -> "ForumTopic" :
126+ def _parse (forum_topic : "raw.types.ForumTopic" ) -> "ForumTopic" :
127+ if isinstance (forum_topic , raw .types .ForumTopicDeleted ):
128+ return types .ForumTopicDeleted ._parse (forum_topic )
127129 from_id = forum_topic .from_id
128130 if isinstance (from_id , raw .types .PeerChannel ):
129131 peer = types .PeerChannel ._parse (from_id )
Original file line number Diff line number Diff line change 1+ # Pyrofork - Telegram MTProto API Client Library for Python
2+ # Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
3+ #
4+ # This file is part of Pyrofork.
5+ #
6+ # Pyrofork is free software: you can redistribute it and/or modify
7+ # it under the terms of the GNU Lesser General Public License as published
8+ # by the Free Software Foundation, either version 3 of the License, or
9+ # (at your option) any later version.
10+ #
11+ # Pyrofork is distributed in the hope that it will be useful,
12+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ # GNU Lesser General Public License for more details.
15+ #
16+ # You should have received a copy of the GNU Lesser General Public License
17+ # along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
18+
19+ from pyrogram import raw , types
20+ from typing import Union
21+ from ..object import Object
22+
23+
24+ class ForumTopicDeleted (Object ):
25+ """A deleted forum topic.
26+
27+ Parameters:
28+ id (``Integer``):
29+ Id of the topic
30+ """
31+
32+ def __init__ (
33+ self ,
34+ * ,
35+ id : int
36+ ):
37+ super ().__init__ ()
38+
39+ self .id = id
40+
41+ @staticmethod
42+ def _parse (forum_topic : "raw.types.ForumTopicDeleted" ) -> "ForumTopicDeleted" :
43+ return ForumTopicDeleted (
44+ id = getattr (forum_topic ,"id" , None )
45+ )
You can’t perform that action at this time.
0 commit comments