Пытаюсь загрузить фотографию но выходит такая ошибка:
Traceback (most recent call last):
File "C:\Users\1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vkbottle\framework\framework\swear_handle
r.py", line 26, in wrapper
return await func(*args, **kwargs)
File "C:\Users\1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vkbottle\framework\bot\processor.py", lin
e 35, in parent_processor
return await self.message_processor(obj, client_info)
File "C:\Users\1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vkbottle\framework\bot\processor.py", lin
e 81, in message_processor
task = await rules[0].call(*args, **kwargs)
File "C:\Users\1\Desktop\test\main.py", line 569, in wrapper
photo = await photo_uploader.upload_message_photo(fp)
File "C:\Users\1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vkbottle\api\uploader\photo.py", line 79,
in upload_message_photo
photo = await self.api.request("photos.saveMessagesPhoto", uploader)
File "C:\Users\1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vkbottle\api\api\api.py", line 75, in req
uest
raw_response=raw_response,
File "C:\Users\1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vkbottle\api\api\request.py", line 31, in
__call__
error_handler=self.error_handler,
File "C:\Users\1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vkbottle\api\api\util\requester.py", line
68, in request
return await error_handler.handle_error(exception)
File "C:\Users\1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vkbottle\api\api\error_handler\error_hand
ler.py", line 28, in handle_error
return await self.unhandled_error(e)
File "C:\Users\1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vkbottle\api\api\error_handler\error_hand
ler.py", line 58, in unhandled_error
raise e
vkbottle.utils.exceptions.VKError: (100, 'One of the parameters specified was missing or invalid: photos_list is invalid
', , {'server': 843030, 'photo': '[]', 'hash': '726a96306a0220d408c93d35a6208b61'})
@bot.on.private_message(text="/img")
async def load_photo(message: Message):
for i in message.attachments:
u_=(i.photo.sizes[-5].url)
img_data = requests.get(u_).content
with open('config/photo.jpg', 'wb') as handler:
handler.write(img_data)