From f5b265d6140070985d39cafd1f9a9342238b055d Mon Sep 17 00:00:00 2001 From: Oleg A Date: Wed, 10 Mar 2021 18:35:29 +0300 Subject: [PATCH] Voice Chat types added --- aiogram/types/__init__.py | 6 ++++++ aiogram/types/voice_chat_ended.py | 13 +++++++++++++ aiogram/types/voice_chat_participants_invited.py | 16 ++++++++++++++++ aiogram/types/voice_chat_started.py | 12 ++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 aiogram/types/voice_chat_ended.py create mode 100644 aiogram/types/voice_chat_participants_invited.py create mode 100644 aiogram/types/voice_chat_started.py diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py index eba6f1d3..da397996 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -69,6 +69,9 @@ from .venue import Venue from .video import Video from .video_note import VideoNote from .voice import Voice +from .voice_chat_ended import VoiceChatEnded +from .voice_chat_participants_invited import VoiceChatParticipantsInvited +from .voice_chat_started import VoiceChatStarted from .webhook_info import WebhookInfo __all__ = ( @@ -184,6 +187,9 @@ __all__ = ( 'Video', 'VideoNote', 'Voice', + 'VoiceChatEnded', + 'VoiceChatParticipantsInvited', + 'VoiceChatStarted', 'WebhookInfo', 'base', 'fields', diff --git a/aiogram/types/voice_chat_ended.py b/aiogram/types/voice_chat_ended.py new file mode 100644 index 00000000..f1bb1f05 --- /dev/null +++ b/aiogram/types/voice_chat_ended.py @@ -0,0 +1,13 @@ +from . import base +from . import fields +from . import mixins + + +class VoiceChatEnded(base.TelegramObject, mixins.Downloadable): + """ + This object represents a service message about a voice chat ended in the chat. + + https://core.telegram.org/bots/api#voicechatended + """ + + duration: base.Integer = fields.Field() diff --git a/aiogram/types/voice_chat_participants_invited.py b/aiogram/types/voice_chat_participants_invited.py new file mode 100644 index 00000000..fbd0a457 --- /dev/null +++ b/aiogram/types/voice_chat_participants_invited.py @@ -0,0 +1,16 @@ +import typing + +from . import base +from . import fields +from . import mixins +from .user import User + + +class VoiceChatParticipantsInvited(base.TelegramObject, mixins.Downloadable): + """ + This object represents a service message about new members invited to a voice chat. + + https://core.telegram.org/bots/api#voicechatparticipantsinvited + """ + + users: typing.List[User] = fields.ListField(base=User) diff --git a/aiogram/types/voice_chat_started.py b/aiogram/types/voice_chat_started.py new file mode 100644 index 00000000..3cd76322 --- /dev/null +++ b/aiogram/types/voice_chat_started.py @@ -0,0 +1,12 @@ +from . import base +from . import mixins + + +class VoiceChatStarted(base.TelegramObject, mixins.Downloadable): + """ + This object represents a service message about a voice chat started in the chat. + Currently holds no information. + + https://core.telegram.org/bots/api#voicechatstarted + """ + pass