From b1ac8d3d406a0dbc98c1d6d1d2789adc2a11d49e Mon Sep 17 00:00:00 2001 From: Davte Date: Wed, 3 Jul 2019 17:29:30 +0200 Subject: [PATCH] Allow photo replies to text message updates --- davtelepot/bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/davtelepot/bot.py b/davtelepot/bot.py index ac671c8..0ac37c3 100644 --- a/davtelepot/bot.py +++ b/davtelepot/bot.py @@ -420,7 +420,10 @@ class Bot(TelegramBot): if type(reply) is str: reply = dict(text=reply) try: - return await self.send_message(update=update, **reply) + if 'text' in reply: + return await self.send_message(update=update, **reply) + if 'photo' in reply: + return await self.send_photo(update=update, **reply) except Exception as e: logging.error( f"Failed to handle text message:\n{e}",