Queer European MD passionate about IT
Просмотр исходного кода

Allow keyword arguments in custombot initialization

Davte 5 лет назад
Родитель
Сommit
80418bd11c
2 измененных файлов с 8 добавлено и 3 удалено
  1. 1 1
      davtelepot/__init__.py
  2. 7 2
      davtelepot/custombot.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.1.30"
+__version__ = "2.1.31"
 __maintainer__ = "Davide Testa"
 __contact__ = "t.me/davte"
 

+ 7 - 2
davtelepot/custombot.py

@@ -70,9 +70,14 @@ class Bot(davtelepot.bot.Bot):
     - All uncaught events are ignored.
     """
 
-    def __init__(self, token, db_name=None):
+    def __init__(self, token, db_name=None, **kwargs):
         """Instantiate Bot instance, given a token and a db name."""
-        davtelepot.bot.Bot.__init__(self, token=token, database_url=db_name)
+        davtelepot.bot.Bot.__init__(
+            self,
+            token=token,
+            database_url=db_name,
+            **kwargs
+        )
         self.message_handlers['pinned_message'] = self.handle_pinned_message
         self.message_handlers['photo'] = self.handle_photo_message
         self.message_handlers['location'] = self.handle_location