aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar TizzySaurus <[email protected]>2023-03-14 13:35:10 +0000
committerGravatar TizzySaurus <[email protected]>2023-03-14 13:35:10 +0000
commitf1ccda4eabd18de725f4d5b22d937f513f3689fc (patch)
treea9dbf152bd28c58cbbcc6421d0b78b25b7c7f195 /bot
parentCorrectly handle when the movie API doesn't return any movies (diff)
Fix linting
Diffstat (limited to 'bot')
-rw-r--r--bot/exts/holidays/halloween/scarymovie.py7
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}",