From 61e7ff9a474a17566878cc873dac00f297ce54b3 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Fri, 17 Nov 2017 23:02:12 +0200 Subject: [PATCH] Change timeout calculator in ChatActions helper. --- aiogram/types/chat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py index d414c479..269d538f 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -217,7 +217,7 @@ class ChatActions(helper.Helper): await asyncio.sleep(sleep) @classmethod - def calc_timeout(cls, text, timeout=.05): + def calc_timeout(cls, text, timeout=.8): """ Calculate timeout for text @@ -235,6 +235,8 @@ class ChatActions(helper.Helper): :param sleep: sleep timeout :return: """ + if isinstance(sleep, str): + sleep = cls.calc_timeout(sleep) await cls._do(cls.TYPING, sleep) @classmethod