Esempio n. 1
0
 /**
  * Unload a module config and all it's mappings from the
  * bot. Basically the opposite of above
  *
  * @param string full namespace of the module config
  */
 public static function unloadModuleConfig($moduleConfig)
 {
     foreach ($moduleConfig::$mappedCommands as $command => $module) {
         static::unmapCommand($command, $module);
     }
     foreach ($moduleConfig::$mappedEvents as $event => $module) {
         static::unmapEvent($event, $module);
     }
     foreach ($moduleConfig::$mappedTriggers as $regexString => $module) {
         static::unmapTrigger($regexString, $module);
     }
     foreach ($moduleConfig::$help as $command => $commandData) {
         HelpManager::unregisterCommand($command);
     }
     $moduleConfig = explode("\\", $moduleConfig);
     foreach (static::$loadedModuleFolders as $id => $loadedModuleFolder) {
         if ($moduleConfig[1] == $loadedModuleFolder) {
             unset(static::$loadedModuleFolders[$id]);
         }
     }
 }