Skip to content

Commit

Permalink
docs: Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Feb 12, 2024
1 parent be64047 commit e7edd0f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
)


async def main() -> None:
async def main() -> None: # noqa: C901
async with enka.EnkaAPI() as api:
# Update assets
# await api.update_assets()

try:
response = await api.fetch_showcase(738081787)
response = await api.fetch_showcase(831335713)
except enka.exceptions.PlayerDoesNotExistError:
return print("Player does not exist.")
except enka.exceptions.GameMaintenanceError:
Expand All @@ -40,7 +40,10 @@ async def main() -> None:
print("Element:", character.element.name.title())
print("Side icon:", character.icon.side)
print(f"Talent levels: {'/'.join(str(talent.level) for talent in character.talents)}")
print("Namecard:", character.namecard.full)
if character.namecard is not None:
print("Namecard:", character.namecard.full)
if character.costume is not None:
print("Costume:", character.costume.icon.gacha)

weapon = character.weapon
print("\nWeapon:")
Expand Down

0 comments on commit e7edd0f

Please sign in to comment.