@bot.on.message_handler(text='doc_from_file', lower=True)
async def photo_from_bytes(ans: Message):
    image = Image.new('RGB', (320, 320), (0, 0, 0))
    image.save('image.png', 'RGB')
    photo = (await doc_uploader.upload_doc_to_message('image.png', ans.peer_id))
    (await ans(attachment=photo))
@bot.on.message_handler(text='doc_from_file', lower=True)
async def photo_from_bytes(ans: Message):
    image = Image.new('RGB', (320, 320), (0, 0, 0))
    image.save('image.png', 'RGB')
    photo = (await doc_uploader.upload_doc_to_message('image.png', ans.peer_id))
    (await ans(attachment=photo))