Allow pass `config` param in BaseRoBot init
@@ -42,7 +42,7 @@ class BaseRoBot(object):
def __init__(self, token=None, logger=None,
enable_session=None, session_storage=None,
app_id=None, app_secret=None, encoding_aes_key=None,
- **kwargs):
+ config=None, **kwargs):
self._handlers = dict((k, []) for k in self.message_types)
self._handlers['all'] = []
self.make_error_page = make_error_page
@@ -52,6 +52,7 @@ class BaseRoBot(object):
logger = werobot.logger.logger
self.logger = logger
+ if config is None:
self.config = Config(_DEFAULT_CONFIG)
self.config.update(
TOKEN=token,
@@ -74,6 +75,8 @@ class BaseRoBot(object):
if session_storage:
self.config["SESSION_STORAGE"] = session_storage
+ else:
+ self.config = config
self.use_encryption = False
