From ae7b250e3349bb7cc9aec7729aed6ec2186346e6 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Fri, 13 Nov 2020 14:58:00 -0500 Subject: [PATCH] fixed: Cannot send playlist of audio files (#465) * fixed: Cannot send playlist of audio files #464 * #463 removed document and audio from check * #463 style fix --- aiogram/types/input_media.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aiogram/types/input_media.py b/aiogram/types/input_media.py index 943a534c..e60913ff 100644 --- a/aiogram/types/input_media.py +++ b/aiogram/types/input_media.py @@ -270,10 +270,10 @@ class MediaGroup(base.TelegramObject): media = InputMediaPhoto(**media) elif media_type == 'video': media = InputMediaVideo(**media) - # elif media_type == 'document': - # media = InputMediaDocument(**media) - # elif media_type == 'audio': - # media = InputMediaAudio(**media) + elif media_type == 'document': + media = InputMediaDocument(**media) + elif media_type == 'audio': + media = InputMediaAudio(**media) # elif media_type == 'animation': # media = InputMediaAnimation(**media) else: @@ -282,8 +282,8 @@ class MediaGroup(base.TelegramObject): elif not isinstance(media, InputMedia): raise TypeError(f"Media must be an instance of InputMedia or dict, not {type(media).__name__}") - elif media.type in ('document', 'audio', 'animation'): - raise ValueError(f"This type of media is not supported by media groups!") + elif media.type == 'animation': + raise ValueError("This type of media is not supported by media groups!") self.media.append(media)