Skip to content

Commit af2d131

Browse files
committed
Added the field is_name_implicit to the classes ForumTopic and ForumTopicCreated.
1 parent 8da9fc9 commit af2d131

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

pyrogram/types/chat_topics/forum_topic.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class ForumTopic(Object):
3939
4040
icon_custom_emoji_id (``str``, *optional*):
4141
Unique identifier of the custom emoji shown as the topic icon
42+
43+
is_name_implicit (``bool``, *optional*):
44+
True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot.
4245
4346
creation_date (:py:obj:`~datetime.datetime`, *optional*):
4447
Point in time (Unix timestamp) when the topic was created
@@ -92,6 +95,7 @@ def __init__(
9295
name: str,
9396
icon_color: int,
9497
icon_custom_emoji_id: str = None,
98+
is_name_implicit: bool = None,
9599
creation_date: datetime = None,
96100
creator: "types.Chat" = None,
97101
outgoing: bool = None,
@@ -114,6 +118,7 @@ def __init__(
114118
self.name = name
115119
self.icon_color = icon_color
116120
self.icon_custom_emoji_id = icon_custom_emoji_id
121+
self.is_name_implicit = is_name_implicit
117122
self.creation_date = creation_date
118123
self.creator = creator
119124
self.outgoing = outgoing
@@ -135,7 +140,7 @@ def __init__(
135140
@staticmethod
136141
def _parse(
137142
client: "pyrogram.Client",
138-
forum_topic: "raw.types.ForumTopic",
143+
forum_topic: "raw.base.ForumTopic",
139144
messages: dict, # friendly
140145
users: dict, # raw
141146
chats: dict, # raw
@@ -171,6 +176,7 @@ def _parse(
171176
name=forum_topic.title,
172177
icon_color=forum_topic.icon_color, # TODO
173178
icon_custom_emoji_id=getattr(forum_topic, "icon_emoji_id", None),
179+
is_name_implicit=getattr(forum_topic, "title_missing", False),
174180
creation_date=utils.timestamp_to_datetime(forum_topic.date),
175181
creator=creator,
176182
outgoing=getattr(forum_topic, "my", None),

pyrogram/types/chat_topics/forum_topic_created.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,25 @@ class ForumTopicCreated(Object):
3636
icon_custom_emoji_id (``str``, *optional*):
3737
Unique identifier of the custom emoji shown as the topic icon
3838
39+
is_name_implicit (``bool``, *optional*):
40+
True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot.
41+
3942
"""
4043

4144
def __init__(
4245
self,
4346
*,
4447
name: str,
4548
icon_color: int,
46-
icon_custom_emoji_id: str = None
49+
icon_custom_emoji_id: str = None,
50+
is_name_implicit: bool = None,
4751
):
4852
super().__init__()
4953

5054
self.name = name
5155
self.icon_color = icon_color
5256
self.icon_custom_emoji_id = icon_custom_emoji_id
57+
self.is_name_implicit = is_name_implicit
5358

5459

5560
@staticmethod
@@ -59,5 +64,6 @@ def _parse(
5964
return ForumTopicCreated(
6065
name=topic_create_action.title,
6166
icon_color=topic_create_action.icon_color, # TODO
62-
icon_custom_emoji_id=getattr(topic_create_action, "", None)
67+
icon_custom_emoji_id=getattr(topic_create_action, "", None),
68+
is_name_implicit=getattr(topic_create_action, "title_missing", False),
6369
)

0 commit comments

Comments
 (0)