EnkaNetwork.py/example/characters.py

22 lines
689 B
Python
Raw Normal View History

2022-07-05 06:38:08 +00:00
import asyncio
from enkanetwork import EnkaNetworkAPI, Config
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}")
print(f"Level: {character.level}")
print(f"Ascension: {''*character.ascension}")
print(f"XP: {character.xp}")
print(f"Icon: {character.image.icon}")
print(f"Side icon: {character.image.side}")
print(f"Wish banner: {character.image.gacha}")
print("="*18)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())