Skip to content

Commit

Permalink
Removing redundant fields, formatting embed
Browse files Browse the repository at this point in the history
  • Loading branch information
DMcP89 committed Sep 18, 2024
1 parent 5666903 commit cfaae85
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions harambot/cogs/yahoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ async def stats(self, interaction: discord.Interaction, player_name: str):
await interaction.followup.send("Player not found")

def get_player_embed(self, player):
logger.info(player)
embed = discord.Embed(
title=player["name"]["full"],
description="#" + player["uniform_number"],
Expand All @@ -245,12 +244,17 @@ def get_player_embed(self, player):
embed.add_field(name="Team", value=player["editorial_team_abbr"])
if "bye_weeks" in player:
embed.add_field(name="Bye", value=player["bye_weeks"]["week"])
if "player_points" in player:
embed.add_field(
name="Total Points", value=player["stats"]["total_points"]
)
embed.add_field(name="Owner", value=player["owner"])
embed.set_thumbnail(url=player["image_url"])
if "total_points" in player["stats"]:
embed.add_field(
name="Total Points",
value=player["stats"]["total_points"],
inline=False
)
del(player["stats"]["player_id"])
del(player["stats"]["name"])
del(player["stats"]["position_type"])
for key, value in player["stats"].items():
if key == "total_points":
continue
Expand Down

0 comments on commit cfaae85

Please sign in to comment.