This commit is contained in:
Nexus 2024-04-19 16:41:24 +01:00 committed by GitHub
parent c63f481522
commit 6e17e766bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -750,7 +750,13 @@ class OtherCog(commands.Cog):
self.urls = iter(urls)
self.filename = urls[0].split("/")[-1]
async def save(self, f):
async def save(self, f: str | typing.IO[bytes]):
if isinstance(f, str):
f = open(f, "wb+")
v = await self.save(f)
f.close()
return v
async with httpx.AsyncClient() as client:
response = None
for url in self.urls: