Screenshot bugs..
CODE:
screenshot = pyautogui.screenshot()
await message.answer("Screenshot..")
with io.BytesIO() as bytes_io:
screenshot = pyautogui.screenshot()
with io.BytesIO() as bytes_io:
screenshot.save(byte_io, 'PNG')
byte_io.seek(0)
await message.answer_photo(photo=byte_io)
pydantic_core._pydantic_core.ValidationError: 2 validation errors for SendPhoto photo.is-instance[InputFile] Input should be an instance of InputFile [type=is_instance_of, input_value=<_io.BytesIO object at 0x0000019F5CB3AAC0>, input_type=BytesIO] For further information visit https://errors.pydantic.dev/2.5/v/is_instance_of photo.str Input should be a valid string [type=string_type, input_value=<_io.BytesIO object at 0x0000019F5CB3AAC0>, input_type=BytesIO] For further information visit https://errors.pydantic.dev/2.5/v/string_type
Im tried a lot of (and chatgpt didn’t help..)
Oli_jime is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.