diff --git a/src/backend.py b/src/backend.py
index 84737c8..4fc6518 100644
--- a/src/backend.py
+++ b/src/backend.py
@@ -449,19 +449,20 @@ async def parse_message(self, message: Dict[str, Any]) -> None:
):
raw = message["adaptiveCards"][0]["body"][0]["text"]
images = IMG_RESP.findall(raw)
- if not self.inline:
- media = [InputMediaPhoto(img) for img in images]
- await self.update.effective_message.reply_media_group(
- media,
- caption=f"You: {self.text}",
- parse_mode=ParseMode.HTML,
- )
- else:
- await asyncio.sleep(2)
- await ut.edit_inline(
- self.update,
- self.context,
- f"{msg}\n"
- f"Images can't be sent in addition to "
- f"messages. Use 'image' inline query instead
",
- )
+ if images:
+ if not self.inline:
+ media = [InputMediaPhoto(img) for img in images]
+ await self.update.effective_message.reply_media_group(
+ media,
+ caption=f"You: {self.text}",
+ parse_mode=ParseMode.HTML,
+ )
+ else:
+ await asyncio.sleep(2)
+ await ut.edit_inline(
+ self.update,
+ self.context,
+ f"{msg}\n"
+ f"Images can't be sent in addition to "
+ f"messages. Use 'image' inline query instead
",
+ )