mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 01:53:39 +01:00
Fix save()
This commit is contained in:
parent
adeb3108b1
commit
a36110ed32
1 changed files with 3 additions and 2 deletions
|
@ -754,11 +754,12 @@ class OtherCog(commands.Cog):
|
|||
response = None
|
||||
for url in self.urls:
|
||||
try:
|
||||
response = await client.get(url)
|
||||
response: httpx.Response = await client.get(url)
|
||||
response.raise_for_status()
|
||||
except (httpx.HTTPError, ConnectionError) as e:
|
||||
continue
|
||||
f.write(await response.read())
|
||||
async for chunk in response.aiter_bytes():
|
||||
f.write(chunk)
|
||||
else:
|
||||
raise discord.HTTPException(response, "failed to download any of %s" % ", ".join(self.urls))
|
||||
|
||||
|
|
Loading…
Reference in a new issue