Longman\TelegramBot\Commands\UserCommands\ImageCommand::ShowRandomImage PHP Method

ShowRandomImage() private method

Return the path to a random image in the passed directory.
private ShowRandomImage ( string $dir ) : string
$dir string
return string
    private function ShowRandomImage($dir)
    {
        $image_list = scandir($dir);
        return $dir . '/' . $image_list[mt_rand(2, count($image_list) - 1)];
    }