Queer European MD passionate about IT
Browse Source

Used `edit_message_text` to `reply` if `message_id` is in kwargs

Davte 5 years ago
parent
commit
948ebcd015
2 changed files with 5 additions and 2 deletions
  1. 1 1
      davtelepot/__init__.py
  2. 4 1
      davtelepot/bot.py

+ 1 - 1
davtelepot/__init__.py

@@ -7,7 +7,7 @@ __author__ = "Davide Testa"
 __email__ = "davide@davte.it"
 __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
 __license__ = "GNU General Public License v3.0"
-__version__ = "2.1.9"
+__version__ = "2.1.10"
 __maintainer__ = "Davide Testa"
 __contact__ = "t.me/davte"
 

+ 4 - 1
davtelepot/bot.py

@@ -922,7 +922,10 @@ class Bot(TelegramBot, ObjectWithDatabase):
         """Reply to `update` with proper method according to `kwargs`."""
         method = None
         if 'text' in kwargs:
-            method = self.send_message
+            if 'message_id' in kwargs:
+                method = self.edit_message_text
+            else:
+                method = self.send_message
         elif 'photo' in kwargs:
             method = self.send_photo
         if method is not None: