Queer European MD passionate about IT
Ver código fonte

Add reply keyboard buttons to aliases if necessary

Davte 5 anos atrás
pai
commit
6f45b906ff
2 arquivos alterados com 5 adições e 1 exclusões
  1. 1 1
      davtelepot/__init__.py
  2. 4 0
      davtelepot/bot.py

+ 1 - 1
davtelepot/__init__.py

@@ -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"
 

+ 4 - 0
davtelepot/bot.py

@@ -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}`')