1import io
2import aiohttp
3
4async with aiohttp.ClientSession() as session:
5 async with session.get(my_url) as resp:
6 if resp.status != 200:
7 return await channel.send('Could not download file...')
8 data = io.BytesIO(await resp.read())
9 await channel.send(file=discord.File(data, 'cool_image.png'))
10