diff --git a/api/bots_api/bot_lib.py b/api/bots_api/bot_lib.py index c3fcb3ccb0..ddf115c5f9 100644 --- a/api/bots_api/bot_lib.py +++ b/api/bots_api/bot_lib.py @@ -120,6 +120,8 @@ def run_message_handler_for_bot(lib_module, quiet, config_file): restricted_client = BotHandlerApi(client) message_handler = lib_module.handler_class() + if hasattr(message_handler, 'initialize'): + message_handler.initialize(bot_handler=restricted_client) state_handler = StateHandler()