I was in the proxy.py file in cogs and I saw this snippet of code:
if server_language == "Thai":
url = "https://raw.githubusercontent.com/ShiftyTR/Proxy-List/master/http.txt"
async with aiohttp.ClientSession() as session:
async with session.get(url) as r:
r = await r.text()
with open("data/http.txt", "w") as file:
file.write(r)
file.close()
f = nextcord.File("data/http.txt", filename="http.txt")
await ctx.send(file=f)
When using context managers files are automatically closed! I will create a few pull requests to patch this in any file I see.
I was in the proxy.py file in cogs and I saw this snippet of code:
When using context managers files are automatically closed! I will create a few pull requests to patch this in any file I see.