B
B
BabyDabi2021-01-14 00:11:26
Bots
BabyDabi, 2021-01-14 00:11:26

How to make the bot send photos to telegram from a folder?

How can I make a Python bot on a library (pyTelegramBotAPI) send all the photos from a certain folder to telegram? that is, I would put 100 photos in a folder, and the bot would send all the photos to telegrams.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vano, 2021-01-21
@Sovunya

Try using range(100) to send one photo at a time with this command:

bot.send_photo(chat_id = id_tvoego_chata, photo = open("Моя_фотка.png"))

PS Sending more than one photo in one message will not work, only one photo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question