Register the command.

@param string $command
@return void
14772
protected function registerAppContainerCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Commands\AppContainerCommand($app);
        });
    }
1215145
protected function registerAddonNameCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Addons\Commands\AddonNameCommand($app);
        });
    }
730360
function unregisterCommand(\CharlotteDunois\Livia\Commands\Command $command) {
        $group = $this->resolveGroup($command->groupID);
        $group->commands->delete($command->name);
        $this->commands->delete($command->name);
        
        $this->client->emit('debug', 'Unregistered command '.$command->groupID.':'.$command->name);
        $this->client->emit('commandUnregister', $command, $this);
        
        return $this;
    }
696630
public function addCommand($command)
    {
        if (is_array($command)) {
            foreach ($command as $cmd) {
                $this->addCommand($cmd);
            }
        }

        if (is_string($command)) {
            $command = new Command($command);
            $this->commandsList[] = $command;
        }

        return $this;
    }
856381
protected function registerCommands(array $commands)
    {
        foreach ($commands as $command) {
            if ( ! $command instanceof SymfonyCommand) {
                $command = $this->container[$command];
            }

            $this->container['console']->add($command);
        }
    }
700671
public function unregisterCommand($command)
    {
        if (! array_key_exists($command, $this->commands)) {
            throw new \Exception("A command with the name {$command} does not exist.");
        }

        unset($this->commands[$command]);
    }
123324
protected function registerDatabaseRefreshCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Database\Commands\DatabaseRefreshCommand($app);
        });
    }
437824
protected function sendCommandToServer(string $command): void
	{
		$this->lastCommand = $command;

		$this->connection->write($command);
	}
833449
protected function registerDatabaseCleanCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Database\Commands\DatabaseCleanCommand($app);
        });
    }
1063279
protected function registerDatabaseSeedCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Database\Commands\DatabaseSeedCommand($app);
        });
    }
506576
protected function registerMakeModelCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Generators\Commands\ModelMakeCommand($app);
        });
    }
1276973
public function handle(RegisterMessageCommand $command)
    {
        $message = $this->desc->registerMessage($command->type_name, $command->data_arr);

        //Потом переписать под генерацию событий самим desc объектом
        //и подписку на события
        //а пока:

        $block = $this->queryAgent->getBlock('fidback',[],[]);

        //------------------
        try{
            $inqueue  = $block->inqueue_field;
            if(!$inqueue)
            {
                $inqueue = config('fidback')['inqueue'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $inqueue = config('fidback')['inqueue'];
        }
        //------------------

        try{
            $mailto  = $block->mail_rec_field;
            if(!$mailto)
            {
                $mailto = config('fidback')['mail_rec'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $mailto = config('fidback')['mail_rec'];
        }
        //------------------
        try{
            $mailto_copy1  = $block->mail_rec_copy1_field;
            if(!$mailto_copy1)
            {
                $mailto_copy1 = config('fidback')['mail_rec_copy1'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $mailto_copy1 = config('fidback')['mail_rec_copy1'];
        }
        //------------------
        try{
            $mailto_copy2  = $block->mail_rec_copy2_field;
            if(!$mailto_copy2)
            {
                $mailto_copy2 = config('fidback')['mail_rec_copy2'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $mailto_copy2 = config('fidback')['mail_rec_copy2'];
        }
        //------------------
        try{
            $mailto_copy3  = $block->mail_rec_copy3_field;
            if(!$mailto_copy3)
            {
                $mailto_copy3 = config('fidback')['mail_rec_copy3'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $mailto_copy3 = config('fidback')['mail_rec_copy3'];
        }
        //------------------

        try{
            $username  = $block->mail_username_field;
            if(!$username)
            {
                $username = config('fidback')['mail_username'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $username = config('fidback')['mail_username'];
        }
        //------------------
        try{
            $site_name  = $block->site_name_field;
            if(!$site_name)
            {
                $site_name = config('fidback')['site_name'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $site_name = config('fidback')['site_name'];
        }
        //------------------

        try
        {
            $message_id = $message->id_field;

            if($inqueue)
            {
                Mail::queue('back/mail/'.$command->template,
                    ['item'=>$message],
                    function($message) use ($username, $mailto, $mailto_copy1, $mailto_copy2, $mailto_copy3, $site_name, $message_id)
                    {
                        $message->from($username, $site_name);
                        $message->to($mailto);
                        if($mailto_copy1){
                            $message->cc($mailto_copy1);
                        }
                        if($mailto_copy2){
                            $message->cc($mailto_copy2);
                        }
                        if($mailto_copy3){
                            $message->cc($mailto_copy3);
                        }
                        $message->subject('Сообщение из сайта '.$site_name);

                        Bus::dispatch(new UpdateGroupItemCommand($message_id, ['bools'=>['mailed'=>true]]));

                    },'mailqueue');
            }else{
                Mail::send('back/mail/'.$command->template,
                    ['item'=>$message],
                    function($message) use ($username, $mailto, $mailto_copy1, $mailto_copy2, $mailto_copy3, $site_name, $message_id)
                    {
                        $message->from($username, $site_name);
                        $message->to($mailto);
                        if($mailto_copy1){
                            $message->cc($mailto_copy1);
                        }
                        if($mailto_copy2){
                            $message->cc($mailto_copy2);
                        }
                        if($mailto_copy3){
                            $message->cc($mailto_copy3);
                        }
                        $message->subject('Сообщение из сайта '.$site_name);

                        Bus::dispatch(new UpdateGroupItemCommand($message_id, ['bools'=>['mailed'=>true]]));

                    });
            }
        }catch(\Exception $Exc)
        {
            Log::info($Exc->getMessage());
        }

    }
899673
protected function registerMakeNotificationCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Generators\Commands\NotificationMakeCommand($app);
        });
    }
1009586
public function addConsole($command) {
        /* @var $command Command */
        $command->configure();
        $name = $command->name();
        $this->defaultCommand[ $name ] = $command;
    }
1199305
protected function registerMakeRuleCommand($command)
     {
         $this->app->singleton($command, function ($app) {
             return new Generators\Commands\RuleMakeCommand($app);
         });
     }
272554
public function command($command)
    {
        if ($command instanceof CommandInterface) {
            $command->setContainer($this);
        }

        $this['console']->add($command);
    }
269551
public function registerCommand($command, $help)
    {
        if (isset($this->setup[$command])) {
            throw new Exception("Command $command already registered");
        }

        $this->setup[$command] = array(
            'opts' => array(),
            'args' => array(),
            'help' => $help
        );

    }