Queer European MD passionate about IT
Selaa lähdekoodia

Allow new button syntax also in legacy mode (buttons with no `data`)

Davte 5 vuotta sitten
vanhempi
sitoutus
44055ff181
2 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. 1 1
      davtelepot/__init__.py
  2. 3 2
      davtelepot/custombot.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.3"
+__version__ = "2.1.4"
 __maintainer__ = "Davide Testa"
 __contact__ = "t.me/davte"
 

+ 3 - 2
davtelepot/custombot.py

@@ -537,8 +537,9 @@ class Bot(davtelepot.bot.Bot):
             )
         return decorator
 
-    def button(self, data, descr='', auth='admin', authorization_level=None,
-               prefix=None, description=None, separator=None):
+    def button(self, data=None, descr='', auth='admin',
+               authorization_level=None, prefix=None, description=None,
+               separator=None):
         """Define a bot button.
 
         `descr` and `auth` parameters are deprecated: use `description` and