Merge pull request #1226 from newton-miku/main

修复epic报错,优化简介
This commit is contained in:
HibiKier 2022-12-31 14:15:05 +08:00 committed by GitHub
commit def53aa22e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,9 +112,15 @@ async def get_epic_free(bot: Bot, type_event: str):
if pair["key"] == "publisherName":
game_pub = pair["value"]
if game.get("productSlug"):
gamesDesp = await get_epic_game_desp(game["productSlug"])
#game_desp = game["description"]
game_desp = gamesDesp["description"]
gamesDesp = await get_epic_game_desp(game["productSlug"])
try:
#是否存在简短的介绍
if "shortDescription" in gamesDesp:
game_desp = gamesDesp["shortDescription"]
except KeyError:
game_desp = gamesDesp["description"]
else:
game_desp = game["description"]
try:
end_date_iso = game["promotions"]["promotionalOffers"][0][
"promotionalOffers"