diff options
| author | 2021-09-03 16:28:04 +0100 | |
|---|---|---|
| committer | 2021-09-03 16:28:04 +0100 | |
| commit | cd7060835b5b0d150c6e91d75bc3227ee43db0ba (patch) | |
| tree | 4264ddbb25e86184255574cfd0e8fa9bb11d7bcb /bot/exts/evergreen/movie.py | |
| parent | Handle status not found with 404 picture (diff) | |
| parent | Merge pull request #839 from python-discord/android-codeblock-fix (diff) | |
Merge branch 'main' into teapot-support
Diffstat (limited to 'bot/exts/evergreen/movie.py')
| -rw-r--r-- | bot/exts/evergreen/movie.py | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/bot/exts/evergreen/movie.py b/bot/exts/evergreen/movie.py index c6af4bcd..a04eeb41 100644 --- a/bot/exts/evergreen/movie.py +++ b/bot/exts/evergreen/movie.py @@ -1,7 +1,7 @@  import logging  import random  from enum import Enum -from typing import Any, Dict, List, Tuple +from typing import Any  from aiohttp import ClientSession  from discord import Embed @@ -107,7 +107,7 @@ class Movie(Cog):          """Show all currently available genres for .movies command."""          await ctx.send(f"Current available genres: {', '.join('`' + genre.name + '`' for genre in MovieGenres)}") -    async def get_movies_data(self, client: ClientSession, genre_id: str, page: int) -> List[Dict[str, Any]]: +    async def get_movies_data(self, client: ClientSession, genre_id: str, page: int) -> list[dict[str, Any]]:          """Return JSON of TMDB discover request."""          # Define params of request          params = { @@ -126,7 +126,7 @@ class Movie(Cog):          async with client.get(url, params=params) as resp:              return await resp.json() -    async def get_pages(self, client: ClientSession, movies: Dict[str, Any], amount: int) -> List[Tuple[str, str]]: +    async def get_pages(self, client: ClientSession, movies: dict[str, Any], amount: int) -> list[tuple[str, str]]:          """Fetch all movie pages from movies dictionary. Return list of pages."""          pages = [] @@ -139,7 +139,7 @@ class Movie(Cog):          return pages -    async def get_movie(self, client: ClientSession, movie: int) -> Dict: +    async def get_movie(self, client: ClientSession, movie: int) -> dict[str, Any]:          """Get Movie by movie ID from TMDB. Return result dictionary."""          if not isinstance(movie, int):              raise ValueError("Error while fetching movie from TMDB, movie argument must be integer. ") @@ -148,7 +148,7 @@ class Movie(Cog):          async with client.get(url, params=MOVIE_PARAMS) as resp:              return await resp.json() -    async def create_page(self, movie: Dict[str, Any]) -> Tuple[str, str]: +    async def create_page(self, movie: dict[str, Any]) -> tuple[str, str]:          """Create page from TMDB movie request result. Return formatted page + image."""          text = ""  |