protected static function getChecker($name)
    {
        return function (Update $update) use ($name) {
            $message = $update->getMessage();
            if (is_null($message) || !strlen($message->getText())) {
                return false;
            }

            preg_match(self::REGEXP, $message->getText(), $matches);

            return !empty($matches) && $matches[1] == $name;
        };
    }
protected static function getChecker($name)
    {
        return function (Update $update) use ($name) {
            $message = $update->getMessage();
            if (is_null($message) || !strlen($message->getText())) {
                return false;
            }

            preg_match(self::REGEXP, $message->getText(), $matches);

            return !empty($matches) && $matches[1] == $name;
        };
    }
protected static function getChecker ( $ name ) { return function ( Update $ update ) use ( $ name ) { $ message = $ update -> getMessage ( ) ; if ( is_null ( $ message ) || ! strlen ( $ message -> getText ( ) ) ) { return false ; } preg_match ( self :: REGEXP , $ message -> getText ( ) , $ matches ) ; return ! empty ( $ matches ) && $ matches [ 1 ] == $ name ; } ; }
Returns check function to handling the command.

@param string $name

@return \Closure
Returns check function to handling the command .