Skip to content

Commit

Permalink
Pyrofork: Add topic id to topic created services messages
Browse files Browse the repository at this point in the history
Signed-off-by: wulan17 <wulan17@nusantararom.org>
  • Loading branch information
wulan17 committed Sep 9, 2023
1 parent fdc9c72 commit e1ff81f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyrogram/methods/chats/create_forum_topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ async def create_forum_topic(
)
)

return types.ForumTopicCreated._parse(r.updates[1].message.action)
return types.ForumTopicCreated._parse(r.updates[1].message)
14 changes: 10 additions & 4 deletions pyrogram/types/user_and_chats/forum_topic_created.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class ForumTopicCreated(Object):
Parameters:
id (``Integer``):
Id of the topic
title (``String``):
Name of the topic.
Expand All @@ -37,22 +40,25 @@ class ForumTopicCreated(Object):

def __init__(
self, *,
id: int,
title: str,
icon_color: int,
icon_emoji_id: int = None
):
super().__init__()

self.id = id
self.title = title
self.icon_color = icon_color
self.icon_emoji_id = icon_emoji_id

@staticmethod
def _parse(action: "raw.types.MessageActionTopicCreate") -> "ForumTopicCreated":
def _parse(message: "raw.base.Message") -> "ForumTopicCreated":


return ForumTopicCreated(
title=getattr(action,"title", None),
icon_color=getattr(action,"icon_color", None),
icon_emoji_id=getattr(action,"icon_emoji_id", None)
id=getattr(message, "id", None),
title=getattr(message.action,"title", None),
icon_color=getattr(message.action,"icon_color", None),
icon_emoji_id=getattr(message.action,"icon_emoji_id", None)
)

0 comments on commit e1ff81f

Please sign in to comment.