From da8dc6b111d4aad6f0f8db0109a9b9b7cee02361 Mon Sep 17 00:00:00 2001 From: katant Date: Sun, 6 Nov 2022 08:14:56 +1000 Subject: [PATCH] Added new classes for topics --- aiogram/types/__init__.py | 6 ++++++ aiogram/types/forum_topic_closed.py | 10 ++++++++++ aiogram/types/forum_topic_created.py | 13 +++++++++++++ aiogram/types/forum_topic_reopened.py | 10 ++++++++++ aiogram/types/message.py | 6 ++++++ aiogram/types/video_chat_started.py | 2 +- 6 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 aiogram/types/forum_topic_closed.py create mode 100644 aiogram/types/forum_topic_created.py create mode 100644 aiogram/types/forum_topic_reopened.py diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py index 2c272fef..87dc1e9e 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -29,6 +29,9 @@ from .encrypted_credentials import EncryptedCredentials from .encrypted_passport_element import EncryptedPassportElement from .file import File from .force_reply import ForceReply +from .forum_topic_created import ForumTopicCreated +from .forum_topic_closed import ForumTopicClosed +from .forum_topic_reopened import ForumTopicReopened from .game import Game from .game_high_score import GameHighScore from .inline_keyboard import InlineKeyboardButton, InlineKeyboardMarkup @@ -240,6 +243,9 @@ __all__ = ( 'WebAppData', 'WebAppInfo', 'WebhookInfo', + 'ForumTopicCreated', + 'ForumTopicClosed', + 'ForumTopicReopened', 'base', 'fields', ) diff --git a/aiogram/types/forum_topic_closed.py b/aiogram/types/forum_topic_closed.py new file mode 100644 index 00000000..3bcac712 --- /dev/null +++ b/aiogram/types/forum_topic_closed.py @@ -0,0 +1,10 @@ +from . import base + + +class ForumTopicClosed(base.TelegramObject): + """ + This object represents a service message about a forum topic closed in the chat. Currently holds no information. + + https://core.telegram.org/bots/api#forumtopicclosed + """ + pass diff --git a/aiogram/types/forum_topic_created.py b/aiogram/types/forum_topic_created.py new file mode 100644 index 00000000..ac348206 --- /dev/null +++ b/aiogram/types/forum_topic_created.py @@ -0,0 +1,13 @@ +from . import base +from . import fields + + +class ForumTopicCreated(base.TelegramObject): + """ + This object represents a service message about a new forum topic created in the chat. + + https://core.telegram.org/bots/api#forumtopiccreated + """ + name: base.String = fields.Field() + icon_color: base.Integer = fields.Field() + icon_custom_emoji_id: base.String = fields.Field() diff --git a/aiogram/types/forum_topic_reopened.py b/aiogram/types/forum_topic_reopened.py new file mode 100644 index 00000000..45c575cf --- /dev/null +++ b/aiogram/types/forum_topic_reopened.py @@ -0,0 +1,10 @@ +from . import base + + +class ForumTopicReopened(base.TelegramObject): + """ + This object represents a service message about a forum topic closed in the chat. Currently holds no information. + + https://core.telegram.org/bots/api#forumtopicreopened + """ + pass diff --git a/aiogram/types/message.py b/aiogram/types/message.py index c7b32661..4cc319fa 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -41,6 +41,9 @@ from .voice_chat_participants_invited import VoiceChatParticipantsInvited from .voice_chat_scheduled import VoiceChatScheduled from .voice_chat_started import VoiceChatStarted from .web_app_data import WebAppData +from .forum_topic_created import ForumTopicCreated +from .forum_topic_closed import ForumTopicClosed +from .forum_topic_reopened import ForumTopicReopened from ..utils import helper from ..utils import markdown as md from ..utils.text_decorations import html_decoration, markdown_decoration @@ -114,6 +117,9 @@ class Message(base.TelegramObject): voice_chat_participants_invited: VoiceChatParticipantsInvited = fields.Field(base=VoiceChatParticipantsInvited) reply_markup: InlineKeyboardMarkup = fields.Field(base=InlineKeyboardMarkup) web_app_data: WebAppData = fields.Field(base=WebAppData) + forum_topic_created: ForumTopicCreated = fields.Field(base=ForumTopicCreated) + forum_topic_closed: ForumTopicClosed = fields.Field(base=ForumTopicClosed) + forum_topic_reopened: ForumTopicReopened = fields.Field(base=ForumTopicReopened) video_chat_scheduled: VideoChatScheduled = fields.Field(base=VideoChatScheduled) video_chat_started: VideoChatStarted = fields.Field(base=VideoChatStarted) video_chat_ended: VideoChatEnded = fields.Field(base=VideoChatEnded) diff --git a/aiogram/types/video_chat_started.py b/aiogram/types/video_chat_started.py index ec1aefd1..ca0acb20 100644 --- a/aiogram/types/video_chat_started.py +++ b/aiogram/types/video_chat_started.py @@ -4,7 +4,7 @@ from . import mixins class VideoChatStarted(base.TelegramObject, mixins.Downloadable): """ - his object represents a service message about a video chat started in the chat. Currently holds no information. + This object represents a service message about a video chat started in the chat. Currently holds no information. https://core.telegram.org/bots/api#videochatstarted """