Add reply keyboard buttons to aliases if necessary

This commit is contained in:
Davte 2019-07-27 00:00:21 +02:00
parent 1b9c039549
commit 6f45b906ff
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -1601,6 +1601,10 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject):
"""
if not isinstance(command, str):
raise TypeError(f'Command `{command}` is not a string')
if isinstance(reply_keyboard_button, dict):
for button in reply_keyboard_button.values():
if button not in aliases:
aliases.append(button)
if aliases:
if not isinstance(aliases, list):
raise TypeError(f'Aliases is not a list: `{aliases}`')