diff options
| author | 2019-07-22 17:44:21 -0400 | |
|---|---|---|
| committer | 2019-07-22 17:44:21 -0400 | |
| commit | 75585469ebef6e560c6650105c9e6b7a5521bd62 (patch) | |
| tree | a5d63f518f8549179224496a0ea5a761b8379a87 /bot/seasons/evergreen/issues.py | |
| parent | Rename variables for clarity, fix extraneous whitespace from review (diff) | |
Apply suggestions from code review
* Unify use of apostophes & quotes in JSON resources
* Sync use of pathlib to the rest of the codebase
* Remove unnecessary string conversions
* Remove unnecessary dictionary `.get()` call without specifying a default
* Other minor syntax modifications
Co-Authored-By: Mark <[email protected]>
Diffstat (limited to 'bot/seasons/evergreen/issues.py')
| -rw-r--r-- | bot/seasons/evergreen/issues.py | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/bot/seasons/evergreen/issues.py b/bot/seasons/evergreen/issues.py index 840d9ead..c6dbe344 100644 --- a/bot/seasons/evergreen/issues.py +++ b/bot/seasons/evergreen/issues.py @@ -15,7 +15,7 @@ class Issues(commands.Cog):      @commands.command(aliases=("issues",))      async def issue(self, ctx, number: int, repository: str = "seasonalbot", user: str = "python-discord"):          """Command to retrieve issues from a GitHub repository.""" -        url = f"https://api.github.com/repos/{user}/{repository}/issues/{str(number)}" +        url = f"https://api.github.com/repos/{user}/{repository}/issues/{number}"          status = {"404": f"Issue #{str(number)} doesn't exist in the repository {user}/{repository}.",                    "403": f"Rate limit exceeded. Please wait a while before trying again!"} @@ -27,8 +27,8 @@ class Issues(commands.Cog):          valid = discord.Embed(colour=0x00ff37)          valid.add_field(name="Repository", value=f"{user}/{repository}", inline=False) -        valid.add_field(name="Issue Number", value=f"#{str(number)}", inline=False) -        valid.add_field(name="Status", value=json_data.get("state").title()) +        valid.add_field(name="Issue Number", value=f"#{number}", inline=False) +        valid.add_field(name="Status", value=json_data["state"].title())          valid.add_field(name="Link", value=url, inline=False)          if len(json_data.get("body")) < 1024:              valid.add_field(name="Description", value=json_data.get("body"), inline=False) | 
