Queer European MD passionate about IT
瀏覽代碼

Allow photo replies to text message updates

Davte 5 年之前
父節點
當前提交
b1ac8d3d40
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      davtelepot/bot.py

+ 4 - 1
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}",