T
T
tommyfrozen2020-08-19 20:50:58
Python
tommyfrozen, 2020-08-19 20:50:58

Random pictures for telegram bot?

Recently got acquainted with telebot for python. I learned that with the help of bot.send_photo, you can throw pictures to the user. The question is what ideas for a competent random generator of certain pictures? Do not make a random function and write bot.send_photo there 1000 times.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Naumov, 2020-08-19
@tommyfrozen

You can create a list with links to pictures, use the random.choice( <list> ) function. When necessary, you can cut the first link, then the pictures will not be repeated

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question