src/BotManager.php
public function validateSecret(bool $force = false): self
    {
        // If we're running from CLI, secret isn't necessary.
        if ($force || 'cli' !== PHP_SAPI) {
            $secret     = $this->params->getBotParam('secret');
            $secret_get = $this->params->getScriptParam('s');
            if (!isset($secret, $secret_get) || $secret !== $secret_get) {
                throw new InvalidAccessException('Invalid access');
            }
        }

        return $this;
    }
public function validateSecret(bool $force = false): self
    {
        // If we're running from CLI, secret isn't necessary.
        if ($force || 'cli' !== PHP_SAPI) {
            $secret     = $this->params->getBotParam('secret');
            $secret_get = $this->params->getScriptParam('s');
            if (!isset($secret, $secret_get) || $secret !== $secret_get) {
                throw new InvalidAccessException('Invalid access');
            }
        }

        return $this;
    }
public function validateSecret ( bool $ force = false ) : self { // If we're running from CLI, secret isn't necessary. if ( $ force || 'cli' !== PHP_SAPI ) { $ secret = $ this -> params -> getBotParam ( 'secret' ) ; $ secret_get = $ this -> params -> getScriptParam ( 's' ) ; if ( ! isset ( $ secret , $ secret_get ) || $ secret !== $ secret_get ) { throw new InvalidAccessException ( 'Invalid access' ) ; } } return $ this ; }
Make sure the passed secret is valid.

@param bool $force Force validation, even on CLI.

@return \TelegramBot\TelegramBotManager\BotManager
@throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
Make sure the passed secret is valid .