diff options
author | 2021-12-15 17:52:49 +0000 | |
---|---|---|
committer | 2021-12-15 17:52:49 +0000 | |
commit | 43f1a14765133229053c06bd36517f2f5081f20d (patch) | |
tree | 1766f2f01b2aca465001dde00c15ab4a56970dc7 | |
parent | added key check (diff) |
Adding suggestions, removing erroneous commit
-rw-r--r-- | bot/exts/holidays/halloween/candy_collection.py | 9 | ||||
-rw-r--r-- | bot/exts/utilities/issues.py | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/bot/exts/holidays/halloween/candy_collection.py b/bot/exts/holidays/halloween/candy_collection.py index 6edce1a0..9b16d543 100644 --- a/bot/exts/holidays/halloween/candy_collection.py +++ b/bot/exts/holidays/halloween/candy_collection.py @@ -173,7 +173,6 @@ class CandyCollection(commands.Cog): async def candy(self, ctx: commands.Context) -> None: """Get the candy leaderboard and save to JSON.""" records = await self.candy_records.items() - user = await self.bot.fetch_user(ctx.author.id) def generate_leaderboard() -> str: top_sorted = sorted( @@ -190,9 +189,9 @@ class CandyCollection(commands.Cog): def get_user_candy_score() -> str: for user_id, score in records: - if user_id == user.id: - return f'<@{user.id}>: {score}' - return f'<@{user.id}>: 0' + if user_id == ctx.author.id: + return f'<@{ctx.author.id}>: {score}' + return f'<@{ctx.author.id}>: 0' e = discord.Embed(colour=discord.Colour.og_blurple()) e.add_field( @@ -201,7 +200,7 @@ class CandyCollection(commands.Cog): inline=False ) e.add_field( - name=f'{user.name}' + "'s Candy Score", + name="Your Candy Score", value=get_user_candy_score(), inline=False ) diff --git a/bot/exts/utilities/issues.py b/bot/exts/utilities/issues.py index b3f8340c..b6d5a43e 100644 --- a/bot/exts/utilities/issues.py +++ b/bot/exts/utilities/issues.py @@ -139,7 +139,7 @@ class Issues(commands.Cog): log.trace(f"PR provided, querying GH pulls API for additional information: {pulls_url}") async with self.bot.http_session.get(pulls_url) as p: pull_data = await p.json() - if "draft" in pull_data and pull_data["draft"]: + if pull_data["draft"]: emoji = Emojis.pull_request_draft elif pull_data["state"] == "open": emoji = Emojis.pull_request_open |