Skip to content

Commit

Permalink
update quick example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
staciax committed Dec 29, 2024
1 parent 07f3e45 commit 5c1553b
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,16 @@ $ python3 -m pip install -U valorant.py
import asyncio
import valorant

async def main():
client = valorant.Client(valorant.Locale.thai) # set default locale to thai
async with client:
weapon = client.get_weapon('9c82e19d-4575-0200-1a81-3eacf00cf872') # Vandal
assert weapon is not None

for skin in weapon.skins:
print(skin.display_name) # default locale
print(skin.display_icon)

# specify locale
print(skin.display_name.ja_JP)
print(skin.display_name.japanese)
print(skin.display_name.from_locale(valorant.Locale.japanese))

if skin.theme is not None:
print(skin.theme.display_name)
print(skin.theme.display_icon)

if skin.content_tier is not None:
print(skin.content_tier.display_name)
print(skin.content_tier.display_icon)

for level in skin.levels:
print(level.display_name)
for chroma in skin.chromas:
print(chroma.display_name)
async def main() -> None:
client = valorant.Client()
async with client:
weapons = await client.fetch_weapons()
for weapon in weapons:
print(weapon.display_name)
print(weapon.display_name.ja_JP)
print(weapon.display_name.japanese)
print(weapon.display_icon)


asyncio.run(main())
Expand Down

0 comments on commit 5c1553b

Please sign in to comment.