Skip to content

Commit 610dd4d

Browse files
committed
use self.bot.session.get()
1 parent 0489abd commit 610dd4d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

modules/github.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ async def format_highlight_block(self, url: str, line_adjustment: int = 10):
6868
raw_url = GITHUB_RAW_CONTENT_URL + file_path.replace("blob/", "") # Convert it to a raw user content URL
6969

7070
code = ""
71-
async with aiohttp.ClientSession() as session:
72-
async with session.get(raw_url) as r:
73-
if r.status == 404:
74-
return
71+
async with self.bot.session.get(raw_url) as resp:
72+
if resp.status == 404:
73+
return
7574

76-
code += await r.text()
75+
code += await resp.text()
7776

7877
code = code.splitlines()
7978

0 commit comments

Comments
 (0)