src/BotManager.php
public function run(): self
    {
        // Make sure this is a valid call.
        $this->validateSecret();
        $this->validateRequest();

        if ($this->action->isAction('webhookinfo')) {
            $webhookinfo = Request::getWebhookInfo();
            /** @noinspection ForgottenDebugOutputInspection */
            print_r($webhookinfo->getResult() ?: $webhookinfo->printError(true));
            return $this;
        }
        if ($this->action->isAction(['set', 'unset', 'reset'])) {
            return $this->validateAndSetWebhook();
        }

        $this->setBotExtras();

        if ($this->action->isAction('handle')) {
            $this->handleRequest();
        } elseif ($this->action->isAction('cron')) {
            $this->handleCron();
        }

        return $this;
    }
public function run(): self
    {
        // Make sure this is a valid call.
        $this->validateSecret();
        $this->validateRequest();

        if ($this->action->isAction('webhookinfo')) {
            $webhookinfo = Request::getWebhookInfo();
            /** @noinspection ForgottenDebugOutputInspection */
            print_r($webhookinfo->getResult() ?: $webhookinfo->printError(true));
            return $this;
        }
        if ($this->action->isAction(['set', 'unset', 'reset'])) {
            return $this->validateAndSetWebhook();
        }

        $this->setBotExtras();

        if ($this->action->isAction('handle')) {
            $this->handleRequest();
        } elseif ($this->action->isAction('cron')) {
            $this->handleCron();
        }

        return $this;
    }
public function run ( ) : self { // Make sure this is a valid call. $ this -> validateSecret ( ) ; $ this -> validateRequest ( ) ; if ( $ this -> action -> isAction ( 'webhookinfo' ) ) { $ webhookinfo = Request :: getWebhookInfo ( ) ; /** @noinspection ForgottenDebugOutputInspection */ print_r ( $ webhookinfo -> getResult ( ) ? : $ webhookinfo -> printError ( true ) ) ; return $ this ; } if ( $ this -> action -> isAction ( [ 'set' , 'unset' , 'reset' ] ) ) { return $ this -> validateAndSetWebhook ( ) ; } $ this -> setBotExtras ( ) ; if ( $ this -> action -> isAction ( 'handle' ) ) { $ this -> handleRequest ( ) ; } elseif ( $ this -> action -> isAction ( 'cron' ) ) { $ this -> handleCron ( ) ; } return $ this ; }
Run this thing in all its glory!

@return \TelegramBot\TelegramBotManager\BotManager
@throws \Longman\TelegramBot\Exception\TelegramException
@throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
@throws \TelegramBot\TelegramBotManager\Exception\InvalidWebhookException
@throws \Exception
Run this thing in all its glory!