Поправлена логика задержки отправки сообщения с InputMedia, InputMediaBuffer
This commit is contained in:
parent
54c073ab76
commit
be7f98976e
@ -84,11 +84,15 @@ class SendMessage(BaseConnection):
|
|||||||
|
|
||||||
json['text'] = self.text
|
json['text'] = self.text
|
||||||
|
|
||||||
|
HAS_INPUT_MEDIA = False
|
||||||
|
|
||||||
if self.attachments:
|
if self.attachments:
|
||||||
|
|
||||||
for att in self.attachments:
|
for att in self.attachments:
|
||||||
|
|
||||||
if isinstance(att, InputMedia) or isinstance(att, InputMediaBuffer):
|
if isinstance(att, (InputMedia, InputMediaBuffer)):
|
||||||
|
HAS_INPUT_MEDIA = True
|
||||||
|
|
||||||
input_media = await process_input_media(
|
input_media = await process_input_media(
|
||||||
base_connection=self,
|
base_connection=self,
|
||||||
bot=self.bot,
|
bot=self.bot,
|
||||||
@ -108,7 +112,8 @@ class SendMessage(BaseConnection):
|
|||||||
if self.parse_mode is not None:
|
if self.parse_mode is not None:
|
||||||
json['format'] = self.parse_mode.value
|
json['format'] = self.parse_mode.value
|
||||||
|
|
||||||
await asyncio.sleep(self.bot.after_input_media_delay)
|
if HAS_INPUT_MEDIA:
|
||||||
|
await asyncio.sleep(self.bot.after_input_media_delay)
|
||||||
|
|
||||||
response = None
|
response = None
|
||||||
for attempt in range(self.ATTEMPTS_COUNT):
|
for attempt in range(self.ATTEMPTS_COUNT):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user