mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 01:54:53 +00:00
Change timeout calculator in ChatActions helper.
This commit is contained in:
parent
f11775fcef
commit
61e7ff9a47
1 changed files with 3 additions and 1 deletions
|
|
@ -217,7 +217,7 @@ class ChatActions(helper.Helper):
|
||||||
await asyncio.sleep(sleep)
|
await asyncio.sleep(sleep)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def calc_timeout(cls, text, timeout=.05):
|
def calc_timeout(cls, text, timeout=.8):
|
||||||
"""
|
"""
|
||||||
Calculate timeout for text
|
Calculate timeout for text
|
||||||
|
|
||||||
|
|
@ -235,6 +235,8 @@ class ChatActions(helper.Helper):
|
||||||
:param sleep: sleep timeout
|
:param sleep: sleep timeout
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
if isinstance(sleep, str):
|
||||||
|
sleep = cls.calc_timeout(sleep)
|
||||||
await cls._do(cls.TYPING, sleep)
|
await cls._do(cls.TYPING, sleep)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue