From 6e17e766bfa2edcbe2027078e2075ec2e715f628 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Fri, 19 Apr 2024 16:41:24 +0100 Subject: [PATCH] Force Io --- cogs/other.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cogs/other.py b/cogs/other.py index edc548d..5196b6f 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -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: