Posted by bot in PyCharm. According to the photo, all images from the catalog should be displayed, but when sending a photo or any other team, the chat is empty.
Tell me, what's the problem?
import config import telebot import os bot = telebot.TeleBot(config.token) @bot.message_handler(content_types=['text']) def handle_text(message): if message.text == 'фото': directory = "C:\\Users\\Lamptop\\Desktop\\open" 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) img.close()
bot.polling(none_stop=True)wrote? - Pavel Durmanovrbto quote. That is so -'rb'- Pavel Durmanov