這是我的代碼:PyTeleBot不將圖像發送到用戶的第一個用戶後
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))
根據這個想法,代碼應該發送到每個管理員IMG的照片,但只將其發送到首個管理員,換了別人也給出了一個錯誤:
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"}']
此外,可變IMG繼續<_io.BufferedReader name='img.jpg'>
- 爲什麼與c ode不想將img發送給第二個管理員?
- 如何將圖像發送給第二個管理員?
不,我使用一個圖像循環。事實是,循環不希望發送相同的圖像兩次或更多 –