diff options
| author | 2023-11-06 10:40:24 +0000 | |
|---|---|---|
| committer | 2023-11-06 10:42:02 +0000 | |
| commit | 428c8def8ba10b4a512971115243b6993a3d940b (patch) | |
| tree | 5986c80aca7158e13b19a59f75cc3a6ca6d0f53e /bot/exts/fun/game.py | |
| parent | Use ruff's isort implementation (diff) | |
Format code with new ruff rules
Diffstat (limited to '')
| -rw-r--r-- | bot/exts/fun/game.py | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/bot/exts/fun/game.py b/bot/exts/fun/game.py index b2b18f04..c9824f22 100644 --- a/bot/exts/fun/game.py +++ b/bot/exts/fun/game.py @@ -421,13 +421,13 @@ class Games(Cog):              "url": data["url"],              "description": f"{data['summary']}\n\n" if "summary" in data else "\n",              "release_date": release_date, -            "rating": round(data["total_rating"] if "total_rating" in data else 0, 2), -            "rating_count": data["total_rating_count"] if "total_rating_count" in data else "?", +            "rating": round(data.get("total_rating", 0), 2), +            "rating_count": data.get("total_rating_count", "?"),              "platforms": ", ".join(platform["name"] for platform in data["platforms"]) if "platforms" in data else "?",              "status": GameStatus(data["status"]).name if "status" in data else "?",              "age_ratings": rating,              "made_by": ", ".join(companies), -            "storyline": data["storyline"] if "storyline" in data else "" +            "storyline": data.get("storyline", "")          }          page = GAME_PAGE.format(**formatting) @@ -448,7 +448,7 @@ class Games(Cog):              formatting = {                  "name": game["name"],                  "url": game["url"], -                "rating": round(game["total_rating"] if "total_rating" in game else 0, 2), +                "rating": round(game.get("total_rating", 0), 2),                  "rating_count": game["total_rating_count"] if "total_rating" in game else "?"              }              line = GAME_SEARCH_LINE.format(**formatting) | 
