mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-08 07:54:52 +00:00
Pyrogram: add GeneralTopicHidden and GeneralTopicUnhidden service messages types
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
85184be318
commit
8428de1722
5 changed files with 91 additions and 2 deletions
|
|
@ -72,6 +72,12 @@ class MessageServiceType(AutoName):
|
||||||
FORUM_TOPIC_EDITED = auto()
|
FORUM_TOPIC_EDITED = auto()
|
||||||
"a new forum topic renamed in the chat"
|
"a new forum topic renamed in the chat"
|
||||||
|
|
||||||
|
GENERAL_TOPIC_HIDDEN = auto()
|
||||||
|
"a forum general topic hidden in the chat"
|
||||||
|
|
||||||
|
GENERAL_TOPIC_UNHIDDEN = auto()
|
||||||
|
"a forum general topic unhidden in the chat"
|
||||||
|
|
||||||
VIDEO_CHAT_STARTED = auto()
|
VIDEO_CHAT_STARTED = auto()
|
||||||
"Video chat started"
|
"Video chat started"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,12 @@ class Message(Object, Update):
|
||||||
forum_topic_edited (:obj:`~pyrogram.types.ForumTopicEdited`, *optional*):
|
forum_topic_edited (:obj:`~pyrogram.types.ForumTopicEdited`, *optional*):
|
||||||
Service message: forum topic edited
|
Service message: forum topic edited
|
||||||
|
|
||||||
|
general_topic_hidden (:obj:`~pyrogram.types.GeneralForumTopicHidden`, *optional*):
|
||||||
|
Service message: forum general topic hidden
|
||||||
|
|
||||||
|
general_topic_unhidden (:obj:`~pyrogram.types.GeneralForumTopicUnhidden`, *optional*):
|
||||||
|
Service message: forum general topic unhidden
|
||||||
|
|
||||||
video_chat_scheduled (:obj:`~pyrogram.types.VideoChatScheduled`, *optional*):
|
video_chat_scheduled (:obj:`~pyrogram.types.VideoChatScheduled`, *optional*):
|
||||||
Service message: voice chat scheduled.
|
Service message: voice chat scheduled.
|
||||||
|
|
||||||
|
|
@ -403,6 +409,8 @@ class Message(Object, Update):
|
||||||
forum_topic_closed: "types.ForumTopicClosed" = None,
|
forum_topic_closed: "types.ForumTopicClosed" = None,
|
||||||
forum_topic_reopened: "types.ForumTopicReopened" = None,
|
forum_topic_reopened: "types.ForumTopicReopened" = None,
|
||||||
forum_topic_edited: "types.ForumTopicEdited" = None,
|
forum_topic_edited: "types.ForumTopicEdited" = None,
|
||||||
|
general_topic_hidden: "types.GeneralForumTopicHidden" = None,
|
||||||
|
general_topic_unhidden: "types.GeneralForumTopicUnhidden" = None,
|
||||||
video_chat_scheduled: "types.VideoChatScheduled" = None,
|
video_chat_scheduled: "types.VideoChatScheduled" = None,
|
||||||
video_chat_started: "types.VideoChatStarted" = None,
|
video_chat_started: "types.VideoChatStarted" = None,
|
||||||
video_chat_ended: "types.VideoChatEnded" = None,
|
video_chat_ended: "types.VideoChatEnded" = None,
|
||||||
|
|
@ -488,6 +496,8 @@ class Message(Object, Update):
|
||||||
self.forum_topic_closed = forum_topic_closed
|
self.forum_topic_closed = forum_topic_closed
|
||||||
self.forum_topic_reopened = forum_topic_reopened
|
self.forum_topic_reopened = forum_topic_reopened
|
||||||
self.forum_topic_edited = forum_topic_edited
|
self.forum_topic_edited = forum_topic_edited
|
||||||
|
self.general_topic_hidden = general_topic_hidden
|
||||||
|
self.general_topic_unhidden = general_topic_unhidden
|
||||||
self.video_chat_scheduled = video_chat_scheduled
|
self.video_chat_scheduled = video_chat_scheduled
|
||||||
self.video_chat_started = video_chat_started
|
self.video_chat_started = video_chat_started
|
||||||
self.video_chat_ended = video_chat_ended
|
self.video_chat_ended = video_chat_ended
|
||||||
|
|
@ -547,6 +557,8 @@ class Message(Object, Update):
|
||||||
forum_topic_closed = None
|
forum_topic_closed = None
|
||||||
forum_topic_reopened = None
|
forum_topic_reopened = None
|
||||||
forum_topic_edited = None
|
forum_topic_edited = None
|
||||||
|
general_topic_hidden = None
|
||||||
|
general_topic_unhidden = None
|
||||||
video_chat_scheduled = None
|
video_chat_scheduled = None
|
||||||
video_chat_started = None
|
video_chat_started = None
|
||||||
video_chat_ended = None
|
video_chat_ended = None
|
||||||
|
|
@ -595,9 +607,16 @@ class Message(Object, Update):
|
||||||
if action.title:
|
if action.title:
|
||||||
forum_topic_edited = types.ForumTopicEdited._parse(action)
|
forum_topic_edited = types.ForumTopicEdited._parse(action)
|
||||||
service_type = enums.MessageServiceType.FORUM_TOPIC_EDITED
|
service_type = enums.MessageServiceType.FORUM_TOPIC_EDITED
|
||||||
|
elif action.hidden:
|
||||||
|
general_topic_hidden = types.GeneralTopicHidden()
|
||||||
|
service_type = enums.MessageServiceType.GENERAL_TOPIC_HIDDEN
|
||||||
elif action.closed:
|
elif action.closed:
|
||||||
forum_topic_closed = types.ForumTopicClosed()
|
forum_topic_closed = types.ForumTopicClosed()
|
||||||
service_type = enums.MessageServiceType.FORUM_TOPIC_CLOSED
|
service_type = enums.MessageServiceType.FORUM_TOPIC_CLOSED
|
||||||
|
else:
|
||||||
|
if hasattr(action, "hidden"):
|
||||||
|
general_topic_unhidden = types.GeneralTopicUnhidden()
|
||||||
|
service_type = enums.MessageServiceType.GENERAL_TOPIC_UNHIDDEN
|
||||||
else:
|
else:
|
||||||
forum_topic_reopened = types.ForumTopicReopened()
|
forum_topic_reopened = types.ForumTopicReopened()
|
||||||
service_type = enums.MessageServiceType.FORUM_TOPIC_REOPENED
|
service_type = enums.MessageServiceType.FORUM_TOPIC_REOPENED
|
||||||
|
|
@ -645,6 +664,8 @@ class Message(Object, Update):
|
||||||
forum_topic_closed=forum_topic_closed,
|
forum_topic_closed=forum_topic_closed,
|
||||||
forum_topic_reopened=forum_topic_reopened,
|
forum_topic_reopened=forum_topic_reopened,
|
||||||
forum_topic_edited=forum_topic_edited,
|
forum_topic_edited=forum_topic_edited,
|
||||||
|
general_topic_hidden=general_topic_hidden,
|
||||||
|
general_topic_unhidden=general_topic_unhidden,
|
||||||
video_chat_scheduled=video_chat_scheduled,
|
video_chat_scheduled=video_chat_scheduled,
|
||||||
video_chat_started=video_chat_started,
|
video_chat_started=video_chat_started,
|
||||||
video_chat_ended=video_chat_ended,
|
video_chat_ended=video_chat_ended,
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ from .forum_topic_created import ForumTopicCreated
|
||||||
from .forum_topic_closed import ForumTopicClosed
|
from .forum_topic_closed import ForumTopicClosed
|
||||||
from .forum_topic_reopened import ForumTopicReopened
|
from .forum_topic_reopened import ForumTopicReopened
|
||||||
from .forum_topic_edited import ForumTopicEdited
|
from .forum_topic_edited import ForumTopicEdited
|
||||||
|
from .general_forum_topic_hidden import GeneralTopicHidden
|
||||||
|
from .general_forum_topic_unhidden import GeneralTopicUnhidden
|
||||||
from .peer_channel import PeerChannel
|
from .peer_channel import PeerChannel
|
||||||
from .peer_user import PeerUser
|
from .peer_user import PeerUser
|
||||||
from .video_chat_ended import VideoChatEnded
|
from .video_chat_ended import VideoChatEnded
|
||||||
|
|
@ -67,6 +69,8 @@ __all__ = [
|
||||||
"ForumTopicClosed",
|
"ForumTopicClosed",
|
||||||
"ForumTopicReopened",
|
"ForumTopicReopened",
|
||||||
"ForumTopicEdited",
|
"ForumTopicEdited",
|
||||||
|
"GeneralTopicHidden",
|
||||||
|
"GeneralTopicUnhidden",
|
||||||
"PeerChannel",
|
"PeerChannel",
|
||||||
"PeerUser",
|
"PeerUser",
|
||||||
"VideoChatStarted",
|
"VideoChatStarted",
|
||||||
|
|
|
||||||
29
pyrogram/types/user_and_chats/general_forum_topic_hidden.py
Normal file
29
pyrogram/types/user_and_chats/general_forum_topic_hidden.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Pyrogram - Telegram MTProto API Client Library for Python
|
||||||
|
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
|
||||||
|
#
|
||||||
|
# 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 ..object import Object
|
||||||
|
|
||||||
|
|
||||||
|
class GeneralTopicHidden(Object):
|
||||||
|
"""A service message about a general topic hidden in the chat.
|
||||||
|
|
||||||
|
Currently holds no information.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Pyrogram - Telegram MTProto API Client Library for Python
|
||||||
|
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
|
||||||
|
#
|
||||||
|
# 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 ..object import Object
|
||||||
|
|
||||||
|
|
||||||
|
class GeneralTopicUnhidden(Object):
|
||||||
|
"""A service message about a general topic unhidden in the chat.
|
||||||
|
|
||||||
|
Currently holds no information.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
Loading…
Reference in a new issue