def get_new_foto():
...
return InputFile
def files_count()
...
return count
while True:
if files < Direct.num_of_files:
files = Direct.num_of_files:
photo = get_new_foto()
bot.sendPhoto(...)
sleep(1000)
else:
Direct_num_of_files = files_count()
if Direct_num_of_files == max_files:
break