@dp.message(CommandStart())
async def start(message: Message):
with open('g_1108204259.png', 'r') as photo:
await message.answer_photo(photo, has_spoiler=True)
Input should be an instance of InputFile [type=is_instance_of, input_value=<_io.TextIOWrapper name='...e='r' encoding='cp1251'>, input_type=TextIOWrapper]
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.TextIOWrapper name='...e='r' encoding='cp1251'>, input_type=TextIOWrapper]