aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons/halloween/scarymovie.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/seasons/halloween/scarymovie.py')
-rw-r--r--bot/seasons/halloween/scarymovie.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/bot/seasons/halloween/scarymovie.py b/bot/seasons/halloween/scarymovie.py
index dcff4f58..5651c9bb 100644
--- a/bot/seasons/halloween/scarymovie.py
+++ b/bot/seasons/halloween/scarymovie.py
@@ -13,19 +13,16 @@ TMDB_API_KEY = environ.get('TMDB_API_KEY')
TMDB_TOKEN = environ.get('TMDB_TOKEN')
-class ScaryMovie(commands.Cog):
- """
- Selects a random scary movie and embeds info into discord chat
- """
+class ScaryMovie:
+ """Selects a random scary movie and embeds info into Discord chat."""
def __init__(self, bot):
self.bot = bot
@commands.command(name='scarymovie', alias=['smovie'])
async def random_movie(self, ctx):
- """
- Randomly select a scary movie and display information about it.
- """
+ """Randomly select a scary movie and display information about it."""
+
async with ctx.typing():
selection = await self.select_movie()
movie_details = await self.format_metadata(selection)
@@ -34,9 +31,7 @@ class ScaryMovie(commands.Cog):
@staticmethod
async def select_movie():
- """
- Selects a random movie and returns a json of movie details from TMDb
- """
+ """Selects a random movie and returns a json of movie details from TMDb."""
url = 'https://api.themoviedb.org/4/discover/movie'
params = {
@@ -70,9 +65,7 @@ class ScaryMovie(commands.Cog):
@staticmethod
async def format_metadata(movie):
- """
- Formats raw TMDb data to be embedded in discord chat
- """
+ """Formats raw TMDb data to be embedded in discord chat."""
# Build the relevant URLs.
movie_id = movie.get("id")
@@ -137,5 +130,7 @@ class ScaryMovie(commands.Cog):
def setup(bot):
+ """Scary movie Cog load."""
+
bot.add_cog(ScaryMovie(bot))
log.info("ScaryMovie cog loaded")