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,