From 83d0c7be31a788ff468adeab434d2713a6d357fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20H=C3=B6nig?= Date: Sun, 7 Jan 2018 19:01:58 +0100 Subject: [PATCH] embedded bots: Run bot.initialize() if bot has this function. --- zerver/worker/queue_processors.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index 8a9ad04ebc..4fb56da02c 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -531,6 +531,8 @@ class EmbeddedBotWorker(QueueProcessingWorker): logging.error("Error: User %s has bot with invalid embedded bot service %s" % ( user_profile_id, service.name)) continue + if hasattr(bot_handler, 'initialize'): + bot_handler.initialize(self.get_bot_api_client(user_profile)) if event['trigger'] == 'mention': message['content'] = extract_query_without_mention( message=message,