This is my code:
def paid(first, last, uid, contribution, position, number, description, img):
for admin in const.admins:
sleep(10)
bot.send_photo(admin, img)
sleep(1)
bot.send_message(admin, '✅Пользователь {0} {1} ID {2} оплатил заказ "рулетка".'
'\nВзнос: {3} руб.'
'\nТовар {4} № {5} удален из резерва.'
'\n{6}'.format(first,
last,
uid,
contribution,
position,
number,
description))
According to the idea, the code should send to each admin a photo of img, but it sends it only to the first admin, for the others it gives an error:
telebot.apihelper.ApiException: A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body: [b'{"ok":false,"error_code":400,"description":"Bad Request: file must be non-empty"}'] " 2017-10-05 13:09:18,537 (init.py:292 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body: [b'{"ok":false,"error_code":400,"description":"Bad Request: file must be non-empty"}']
Moreover, the variable img continues to be <_io.BufferedReader name='img.jpg'>
- Why the code does not want to send img to the second admin?
- How to send an image to the second admin?