From fd33adf092014367790717a656e40c535c5cd33e Mon Sep 17 00:00:00 2001 From: D0rs4n <41237606+D0rs4n@users.noreply.github.com> Date: Sat, 7 Aug 2021 21:14:20 +0200 Subject: Use quote_plus instead of quote in the Githubinfo Cog --- bot/exts/evergreen/githubinfo.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bot/exts/evergreen/githubinfo.py') diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 27e607e5..b0eff896 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -1,7 +1,7 @@ import logging import random from datetime import datetime -from urllib.parse import quote +from urllib.parse import quote_plus import discord from discord.ext import commands @@ -37,7 +37,7 @@ class GithubInfo(commands.Cog): async def github_user_info(self, ctx: commands.Context, username: str) -> None: """Fetches a user's GitHub information.""" async with ctx.typing(): - user_data = await self.fetch_data(f"{GITHUB_API_URL}/users/{username}") + user_data = await self.fetch_data(f"{GITHUB_API_URL}/users/{quote_plus(username)}") # User_data will not have a message key if the user exists if "message" in user_data: @@ -91,7 +91,8 @@ class GithubInfo(commands.Cog): ) if user_data["type"] == "User": - embed.add_field(name="Gists", value=f"[{gists}](https://gist.github.com/{quote(username, safe='')})") + embed.add_field(name="Gists", value=f"[{gists}](https://gist.github.com/{quote_plus(username, safe='')}" + f")") embed.add_field( name=f"Organization{'s' if len(orgs)!=1 else ''}", @@ -120,7 +121,7 @@ class GithubInfo(commands.Cog): return async with ctx.typing(): - repo_data = await self.fetch_data(f"{GITHUB_API_URL}/repos/{quote(repo)}") + repo_data = await self.fetch_data(f"{GITHUB_API_URL}/repos/{quote_plus(repo)}") # There won't be a message key if this repo exists if "message" in repo_data: -- cgit v1.2.3