Allow keyword arguments in custombot initialization

This commit is contained in:
Davte 2019-07-22 21:59:31 +02:00
parent 637dca7af2
commit 80418bd11c
2 changed files with 8 additions and 3 deletions

View File

@ -14,7 +14,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.30" __version__ = "2.1.31"
__maintainer__ = "Davide Testa" __maintainer__ = "Davide Testa"
__contact__ = "t.me/davte" __contact__ = "t.me/davte"

View File

@ -70,9 +70,14 @@ class Bot(davtelepot.bot.Bot):
- All uncaught events are ignored. - 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.""" """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['pinned_message'] = self.handle_pinned_message
self.message_handlers['photo'] = self.handle_photo_message self.message_handlers['photo'] = self.handle_photo_message
self.message_handlers['location'] = self.handle_location self.message_handlers['location'] = self.handle_location