Answer the question
In order to leave comments, you need to log in
How to pass a function as an argument to bot.send_photo?
I am writing a bot in python. There is a function that gets pictures by class:
def getImages(limit): # картинки
return soup.find_all('img', class_='market_listing_item_img', limit=limit)
@dp.message_handler(commands=['see_products'])
async def process_seeproducts_command(message: types.Message):
limit = 3
i = 0
while i <= limit:
prices = parser_from_tp.getPrices(limit)
titles = parser_from_tp.getTitles(limit)
quantities = parser_from_tp.getQuantities(limit)
await bot.send_photo(chat_id, url, caption='Товар: '+titles[i].text+'\nЦена: '+prices[i].text+'\nКол-во: '+quantities[i].text)
i = i+1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question