From 99ad26bfa4bc32eae850c956cbf0ecc62cc24fb6 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 13 Feb 2019 10:16:59 +0100 Subject: [PATCH] Lower the maximum amount of requests per container --- telethon/tl/core/messagecontainer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/telethon/tl/core/messagecontainer.py b/telethon/tl/core/messagecontainer.py index 7742aac0..2b0e6f02 100644 --- a/telethon/tl/core/messagecontainer.py +++ b/telethon/tl/core/messagecontainer.py @@ -13,7 +13,12 @@ class MessageContainer(TLObject): # Maximum amount of messages that can't be sent inside a single # container, inclusive. Beyond this limit Telegram will respond # with BAD_MESSAGE 64 (invalid container). - MAXIMUM_LENGTH = 1024 + # + # This limit is not 100% accurate and may in some cases be higher. + # However, sending up to 100 requests at once in a single container + # is a reasonable conservative value, since it could also depend on + # other factors like size per request, but we cannot know this. + MAXIMUM_LENGTH = 100 def __init__(self, messages): self.messages = messages