diff options
| author | 2021-08-08 15:16:17 +0200 | |
|---|---|---|
| committer | 2021-08-08 15:16:17 +0200 | |
| commit | 95d7a4dcf95a1bf444c0ebe46199df56e26289f1 (patch) | |
| tree | c8899f5753bcddcac30ce5d03c9f8ef0076a8a02 /bot/exts/evergreen/githubinfo.py | |
| parent | Refactor wiki_request, add External API related error,-handler (diff) | |
| parent | Merge #804 - circumvent URL injections in various cogs (diff) | |
Resolve merge conflict
Diffstat (limited to '')
| -rw-r--r-- | bot/exts/evergreen/githubinfo.py | 9 | 
1 files changed, 6 insertions, 3 deletions
| diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 27e607e5..d29f3aa9 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, 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,10 @@ 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='')})" +                )                  embed.add_field(                      name=f"Organization{'s' if len(orgs)!=1 else ''}", | 
