Почему я не могу отправить сообщение пользователям моего бота?
filename = 'a.png'
url = "https://api.telegram.org/botxxxxx:yyyyyyyyyyyyy/sendPhoto";
files = {'photo': open(filename, 'rb')}
data = {'chat_id': "538087xx"}
r = requests.post(url, files=files, data=data)
print(r.status_code, r.reason, r.content)
data = {'chat_id': "642201xx"}
r = requests.post(url, files=files, data=data)
print(r.status_code, r.reason, r.content)
data = {'chat_id': "350225xx"}
r = requests.post(url, files=files, data=data)
print(r.status_code, r.reason, r.content)
Я пытаюсь отправить сообщение 3 пользователям, во-первых, я, владелец бота, и я могу получить сообщение.2 других аккаунта уже отправили сообщение боту.но результаты:
(200, 'OK', '{"ok":true,"result":{"message_id":77,"from":{"id":5258785xx,"is_bot":true,"first_name":"anal_bot","username":"rojandco_bot"},"chat":{"id":538087xx,"first_name":"Ehsan","username":"Shirzadi","type":"private"},"date":1542626038,"photo":[{"file_id":"AgADBAADeqwxG0-KmVNFxlFtWWBr7AQvuhoABG2shK_JcTywFuQEAAEC","file_size":1084,"width":90,"height":63},{"file_id":"AgADBAADeqwxG0-KmVNFxlFtWWBr7AQvuhoABKqN07Vwmbw_F-QEAAEC","file_size":12199,"width":320,"height":224},{"file_id":"AgADBAADeqwxG0-KmVNFxlFtWWBr7AQvuhoABCOVGKfhnnt_GeQEAAEC","file_size":49836,"width":800,"height":561},{"file_id":"AgADBAADeqwxG0-KmVNFxlFtWWBr7AQvuhoABAyOV-TH27bRGOQEAAEC","file_size":99617,"width":1280,"height":898}]}}')
(400, 'Bad Request', '{"ok":false,"error_code":400,"description":"Bad Request: file must be non-empty"}')
(400, 'Bad Request', '{"ok":false,"error_code":400,"description":"Bad Request: file must be non-empty"}')