Allow keyword arguments in custombot initialization
This commit is contained in:
parent
637dca7af2
commit
80418bd11c
@ -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"
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user