From c6bddec530c18bf87a96e6584a67eb26e382db34 Mon Sep 17 00:00:00 2001 From: Joscha Date: Tue, 24 May 2016 23:21:34 +0200 Subject: [PATCH] Pass created_in and created_by as arguments instead of setting them after creation --- yaboli/bot.py | 2 +- yaboli/botmanager.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yaboli/bot.py b/yaboli/bot.py index 4bc2887..66de041 100644 --- a/yaboli/bot.py +++ b/yaboli/bot.py @@ -459,7 +459,7 @@ class Bot(): password = None try: - bot = self.manager.create(room, password=password, created_in=self.roomname(), + self.manager.create(room, password=password, created_in=self.roomname(), created_by=message.sender.name) except exceptions.CreateBotException: self.room.send_message("Bot could not be cloned.", parent=message.id) diff --git a/yaboli/botmanager.py b/yaboli/botmanager.py index 26fb3c4..1a91b91 100644 --- a/yaboli/botmanager.py +++ b/yaboli/botmanager.py @@ -48,7 +48,7 @@ class BotManager(): raise exceptions.CreateBotException("max_bots limit hit") else: bot = self.bot_class(room, nick=nick, password=password, manager=self, - created_in=None, created_by=None) + created_in=created_in, created_by=created_by) self._bots[self._bot_id] = bot self._bot_id += 1