
img = open(directory + ‘/’ + random_file + ‘rb’)
FileNotFoundError: No such file or directory: ‘C

А вот кусок кода отвечающий за это:
elif message.text == ‘Цитату’:
log(message, answer)
directory = ‘C

all_files_in_directory = os.listdir(directory)
# print(all_files_in_directory)
# for file in all_files_in_directory:
# img = open(directory + ‘/’ + file, ‘rb’)
# bot.send_chat_action(message.from_user.id, ‘upload photo’)
# bot.send_photo(message.from_user.id, img)
random_file = random.choice(all_files_in_directory)
img = open(directory + ‘/’ + random_file + ‘rb’)
bot.send_chat_action(message.from_user.id, ‘upload_photo’)
bot.send_photo(message.from_user.id, img)
img.close()
То что после # - 2 неработающий вариант без рандома.
А вот инпуты:
import telebot
import constants
import os
import random
import urllib.request as urllib2
Что делать? Как пофиксить этот бред?