getParameter('channel')); $text = $channel->randomOfClass($this->getParameter('category')); $actual_text = is_object($text) ? $text->text_content : $text; $this->bot->sendIRCMessage(IRCMessage::privmsg($channel->twitch_chat, $actual_text)); $log = new ChatBotLog(); $log->channel()->associate($channel); if (is_object($text)) { $log->origin()->associate($text); } $log->text = $actual_text; $log->user()->associate($this->getExecutingUser()); $log->category = $this->getParameter('category'); $log->save(); $resolve(); }); } }