diff options
author | 2023-03-14 13:35:10 +0000 | |
---|---|---|
committer | 2023-03-14 13:35:10 +0000 | |
commit | f1ccda4eabd18de725f4d5b22d937f513f3689fc (patch) | |
tree | a9dbf152bd28c58cbbcc6421d0b78b25b7c7f195 | |
parent | Correctly handle when the movie API doesn't return any movies (diff) |
Fix linting
-rw-r--r-- | bot/exts/holidays/halloween/scarymovie.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bot/exts/holidays/halloween/scarymovie.py b/bot/exts/holidays/halloween/scarymovie.py index 442ed4a5..2e3a726f 100644 --- a/bot/exts/holidays/halloween/scarymovie.py +++ b/bot/exts/holidays/halloween/scarymovie.py @@ -24,7 +24,7 @@ class ScaryMovie(commands.Cog): if not selection: await ctx.send(embed=Embed( title=random.choice(NEGATIVE_REPLIES), - description=f":warning: Failed to select a movie from the API", + description=":warning: Failed to select a movie from the API", color=Colours.soft_red )) return @@ -55,14 +55,13 @@ class ScaryMovie(commands.Cog): async with self.bot.http_session.get(url=url, params=params, headers=headers) as response: data = await response.json() if (results := data.get("results")) is None: - log.warning(f"Failed to select a movie - data returned from API has no 'results' key") + log.warning("Failed to select a movie - data returned from API has no 'results' key") return {} selection_id = random.choice(results).get("id") if selection_id is None: - log.warning(f"Failed to select a movie - selected film didn't have an id") + log.warning("Failed to select a movie - selected film didn't have an id") return {} - # Get full details and credits async with self.bot.http_session.get( url=f"https://api.themoviedb.org/3/movie/{selection_id}", |