mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-06 15:14:52 +00:00
pyrofork: Fix forum topic type hints
Signed-off-by: Yasir <git@yasir.id>
This commit is contained in:
parent
7cda52ac39
commit
b12b4a62f4
2 changed files with 30 additions and 17 deletions
|
|
@ -25,17 +25,17 @@ class ForumTopicCreated(Object):
|
||||||
|
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
id (``Integer``):
|
id (``int``):
|
||||||
Id of the topic
|
Id of the topic
|
||||||
|
|
||||||
title (``String``):
|
title (``str``):
|
||||||
Name of the topic.
|
Name of the topic.
|
||||||
|
|
||||||
icon_color (``Integer``):
|
icon_color (``int``):
|
||||||
Color of the topic icon in RGB format
|
Color of the topic icon in decimal format.
|
||||||
|
|
||||||
icon_emoji_id (``Integer``, *optional*):
|
custom_emoji_id (``int``, *optional*):
|
||||||
Unique identifier of the custom emoji shown as the topic icon
|
Unique identifier of the custom emoji shown as the topic icon.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|
@ -43,14 +43,14 @@ class ForumTopicCreated(Object):
|
||||||
id: int,
|
id: int,
|
||||||
title: str,
|
title: str,
|
||||||
icon_color: int,
|
icon_color: int,
|
||||||
icon_emoji_id: int = None
|
custom_emoji_id: int = None
|
||||||
):
|
):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
self.id = id
|
self.id = id
|
||||||
self.title = title
|
self.title = title
|
||||||
self.icon_color = icon_color
|
self.icon_color = icon_color
|
||||||
self.icon_emoji_id = icon_emoji_id
|
self.custom_emoji_id = custom_emoji_id
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse(message: "raw.base.Message") -> "ForumTopicCreated":
|
def _parse(message: "raw.base.Message") -> "ForumTopicCreated":
|
||||||
|
|
@ -60,5 +60,5 @@ class ForumTopicCreated(Object):
|
||||||
id=getattr(message, "id", None),
|
id=getattr(message, "id", None),
|
||||||
title=getattr(message.action,"title", None),
|
title=getattr(message.action,"title", None),
|
||||||
icon_color=getattr(message.action,"icon_color", None),
|
icon_color=getattr(message.action,"icon_color", None),
|
||||||
icon_emoji_id=getattr(message.action,"icon_emoji_id", None)
|
custom_emoji_id=getattr(message.action,"icon_emoji_id", None)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -25,27 +25,38 @@ class ForumTopicEdited(Object):
|
||||||
|
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
title (``String``):
|
title (``str``):
|
||||||
Name of the topic.
|
Name of the topic.
|
||||||
|
|
||||||
icon_color (``Integer``):
|
icon_color (``int``):
|
||||||
Color of the topic icon in RGB format
|
Color of the topic icon in decimal format.
|
||||||
|
|
||||||
icon_custom_emoji_id (``String``, *optional*):
|
custom_emoji_id (``str``, *optional*):
|
||||||
Unique identifier of the custom emoji shown as the topic icon
|
Unique identifier of the custom emoji shown as the topic icon.
|
||||||
|
|
||||||
|
is_closed (``bool``, *optional*):
|
||||||
|
True, if the topic is closed.
|
||||||
|
|
||||||
|
is_hidden (``bool``, *optional*):
|
||||||
|
True, if the topic is hidden.
|
||||||
|
Valid only for the "General" topic with id=1
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, *,
|
self, *,
|
||||||
title: str = None,
|
title: str = None,
|
||||||
icon_color: int = None,
|
icon_color: int = None,
|
||||||
icon_emoji_id: str = None
|
custom_emoji_id: int = None,
|
||||||
|
is_closed: bool = None,
|
||||||
|
is_hidden: bool = None
|
||||||
):
|
):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
self.title = title
|
self.title = title
|
||||||
self.icon_color = icon_color
|
self.icon_color = icon_color
|
||||||
self.icon_emoji_id = icon_emoji_id
|
self.custom_emoji_id = custom_emoji_id
|
||||||
|
self.is_closed = is_closed
|
||||||
|
self.is_hidden = is_hidden
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse(action: "raw.types.MessageActionTopicEdit") -> "ForumTopicEdited":
|
def _parse(action: "raw.types.MessageActionTopicEdit") -> "ForumTopicEdited":
|
||||||
|
|
@ -54,5 +65,7 @@ class ForumTopicEdited(Object):
|
||||||
return ForumTopicEdited(
|
return ForumTopicEdited(
|
||||||
title=getattr(action,"title", None),
|
title=getattr(action,"title", None),
|
||||||
icon_color=getattr(action,"icon_color", None),
|
icon_color=getattr(action,"icon_color", None),
|
||||||
icon_emoji_id=getattr(action,"icon_emoji_id", None)
|
custom_emoji_id=getattr(action, "icon_emoji_id", None),
|
||||||
|
is_closed=getattr(action, "closed", None),
|
||||||
|
is_hidden=getattr(action, "hidden", None)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue