Used edit_message_text to reply if message_id is in kwargs

This commit is contained in:
Davte 2019-07-18 12:07:06 +02:00
parent 3cb912154b
commit 948ebcd015
2 changed files with 5 additions and 2 deletions

View File

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

View File

@ -922,7 +922,10 @@ class Bot(TelegramBot, ObjectWithDatabase):
"""Reply to `update` with proper method according to `kwargs`.""" """Reply to `update` with proper method according to `kwargs`."""
method = None method = None
if 'text' in kwargs: 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: elif 'photo' in kwargs:
method = self.send_photo method = self.send_photo
if method is not None: if method is not None: