function resolveCommand($resolvable) {
        if($resolvable instanceof \CharlotteDunois\Livia\Commands\Command) {
            return $resolvable;
        }
        
        if($resolvable instanceof \CharlotteDunois\Livia\Commands\Context) {
            return $resolvable->command;
        }
        
        $commands = $this->findCommands($resolvable, true);
        if(\count($commands) === 1) {
            return $commands[0];
        }
        
        throw new \RuntimeException('Unable to resolve command');
    }
function resolveCommand($resolvable) {
        if($resolvable instanceof \CharlotteDunois\Livia\Commands\Command) {
            return $resolvable;
        }
        
        if($resolvable instanceof \CharlotteDunois\Livia\Commands\Context) {
            return $resolvable->command;
        }
        
        $commands = $this->findCommands($resolvable, true);
        if(\count($commands) === 1) {
            return $commands[0];
        }
        
        throw new \RuntimeException('Unable to resolve command');
    }
function resolveCommand ( $ resolvable ) { if ( $ resolvable instanceof \ CharlotteDunois \ Livia \ Commands \ Command ) { return $ resolvable ; } if ( $ resolvable instanceof \ CharlotteDunois \ Livia \ Commands \ Context ) { return $ resolvable -> command ; } $ commands = $ this -> findCommands ( $ resolvable , true ) ; if ( \ count ( $ commands ) === 1 ) { return $ commands [ 0 ] ; } throw new \ RuntimeException ( 'Unable to resolve command' ) ; }
Resolves a given command, command name or command message to the command.
@param string|\CharlotteDunois\Livia\Commands\Command|\CharlotteDunois\Livia\Commands\Context  $resolvable
@return \CharlotteDunois\Livia\Commands\Command
@throws \RuntimeException
Resolves a given command command name or command message to the command .