EnkaNetwork.py/example/characters.py

26 lines
943 B
Python
Raw Normal View History

2022-07-05 06:38:08 +00:00
import asyncio
from enkanetwork import EnkaNetworkAPI
2022-07-05 06:38:08 +00:00
client = EnkaNetworkAPI(lang="th")
async def main():
data = await client.fetch_user(843715177)
print("=== Characters ===")
for character in data.characters:
print(f"ID: {character.id}")
print(f"Name: {character.name}")
2022-07-17 06:08:31 +00:00
print(f"Level: {character.level} / {character.max_level}")
2022-08-03 07:50:30 +00:00
print(f"Rarity: {character.rarity}")
2022-07-12 19:56:28 +00:00
print(f"Element: {character.element}")
2022-07-17 16:52:24 +00:00
print(f"Friendship Level: {character.friendship_level}")
2022-07-05 06:38:08 +00:00
print(f"Ascension: {''*character.ascension}")
2022-07-18 08:53:09 +00:00
print(f"Constellations unlocked: C{character.constellations_unlocked}")
2022-07-05 06:38:08 +00:00
print(f"XP: {character.xp}")
print(f"Icon: {character.image.icon}")
print(f"Side icon: {character.image.side}")
print(f"Wish banner: {character.image.banner}")
2022-07-05 06:38:08 +00:00
print("="*18)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())