getTriggers(); $commands = array_map(function (Command $item) { $package = PackageCache::getInstance()->getPackage($item->packageID)->package; return [ 'package' => $package , 'identifier' => $item->identifier , 'commandID' => $item->commandID , 'module' => $item->getProcessor()->getJavaScriptModuleName() , 'isAvailable' => $item->getProcessor()->isAvailable($this->room) && ($item->hasTriggers() || $item->getProcessor()->allowWithoutTrigger()) ]; }, CommandCache::getInstance()->getCommands()); $messageTypes = array_map(function ($item) { return [ 'module' => $item->getProcessor()->getJavaScriptModuleName() ]; }, ObjectTypeCache::getInstance()->getObjectTypes('be.bastelstu.chat.messageType')); $config = [ 'clientVersion' => 1 , 'reloadTime' => (int) CHAT_RELOADTIME , 'autoAwayTime' => (int) CHAT_AUTOAWAYTIME , 'commands' => $commands , 'triggers' => $triggers , 'messageTypes' => $messageTypes ]; \wcf\system\event\EventHandler::getInstance()->fireAction($this, 'config', $config); return \wcf\util\JSON::encode($config); } }