mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
enh: remove unnecessarily strict condition in send_media_group (#742)
* enh: remove unneccesarily strict condition in send_media_group * enh: return check but less strict * fix: remove trailing whitespace
This commit is contained in:
parent
a57f9cfc70
commit
57aea755a2
1 changed files with 3 additions and 3 deletions
|
|
@ -1005,9 +1005,9 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
if isinstance(media, list):
|
||||
media = types.MediaGroup(media)
|
||||
|
||||
# check MediaGroup quantity
|
||||
if not 2 <= len(media.media) <= 10:
|
||||
raise ValidationError("Media group must include 2-10 items")
|
||||
# Check MediaGroup quantity
|
||||
if not (1 <= len(media.media) <= 10):
|
||||
raise ValidationError("Media group must include 2-10 items as written in docs, but also it works with 1 element")
|
||||
|
||||
files = dict(media.get_files())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue