embedded bots: Run bot.initialize() if bot has this function.

This commit is contained in:
Robert Hönig 2018-01-07 19:01:58 +01:00
parent dcd62f92fb
commit 83d0c7be31
1 changed files with 2 additions and 0 deletions

View File

@ -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,