function registerType(...$type) {
        foreach($type as $t) {
            $oldT = $t;
            
            if(!($t instanceof \CharlotteDunois\Livia\Types\ArgumentType)) {
                $t = new $t($this->client);
            }
            
            if(!($t instanceof \CharlotteDunois\Livia\Types\ArgumentType)) {
                throw new \InvalidArgumentException(\var_export($oldT, true).' is not an instance of ArgumentType');
            }
            
            if($this->types->has($t->id)) {
                throw new \RuntimeException('Can not register another argument type with the ID '.$t->id);
            }
            
            $this->types->set($t->id, $t);
            
            $this->client->emit('debug', 'Registered type '.$t->id);
            $this->client->emit('typeRegister', $t, $this);
        }
        
        return $this;
    }
function registerType(...$type) {
        foreach($type as $t) {
            $oldT = $t;
            
            if(!($t instanceof \CharlotteDunois\Livia\Types\ArgumentType)) {
                $t = new $t($this->client);
            }
            
            if(!($t instanceof \CharlotteDunois\Livia\Types\ArgumentType)) {
                throw new \InvalidArgumentException(\var_export($oldT, true).' is not an instance of ArgumentType');
            }
            
            if($this->types->has($t->id)) {
                throw new \RuntimeException('Can not register another argument type with the ID '.$t->id);
            }
            
            $this->types->set($t->id, $t);
            
            $this->client->emit('debug', 'Registered type '.$t->id);
            $this->client->emit('typeRegister', $t, $this);
        }
        
        return $this;
    }
function registerType ( ... $ type ) { foreach ( $ type as $ t ) { $ oldT = $ t ; if ( ! ( $ t instanceof \ CharlotteDunois \ Livia \ Types \ ArgumentType ) ) { $ t = new $ t ( $ this -> client ) ; } if ( ! ( $ t instanceof \ CharlotteDunois \ Livia \ Types \ ArgumentType ) ) { throw new \ InvalidArgumentException ( \ var_export ( $ oldT , true ) . ' is not an instance of ArgumentType' ) ; } if ( $ this -> types -> has ( $ t -> id ) ) { throw new \ RuntimeException ( 'Can not register another argument type with the ID ' . $ t -> id ) ; } $ this -> types -> set ( $ t -> id , $ t ) ; $ this -> client -> emit ( 'debug' , 'Registered type ' . $ t -> id ) ; $ this -> client -> emit ( 'typeRegister' , $ t , $ this ) ; } return $ this ; }
Registers a type. Emits a typeRegister event for each type.
@param \CharlotteDunois\Livia\Types\ArgumentType|string  ...$type  The full qualified class name or an initiated instance of it.
@return $this
@throws \RuntimeException
@throws \InvalidArgumentException
Registers a type . Emits a typeRegister event for each type .