Pass created_in and created_by as arguments instead of setting them after creation

This commit is contained in:
Joscha 2016-05-24 23:21:34 +02:00
parent 76b88fb1e7
commit c6bddec530
2 changed files with 2 additions and 2 deletions

View file

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

View file

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