Skip to content

Commit

Permalink
Add get_zzz_characters method
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Jul 10, 2024
1 parent 96f4eca commit cc50439
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion genshin/client/components/chronicle/zzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import typing

from genshin import errors, types, utility
from genshin.models.zzz import chronicle as models
from genshin.models import zzz as models

from . import base

Expand Down Expand Up @@ -87,3 +87,10 @@ async def get_zzz_user(
"""Get ZZZ user stats."""
data = await self._request_zzz_record("index", uid, lang=lang, cache=False)
return models.ZZZUserStats(**data)

async def get_zzz_characters(
self, uid: typing.Optional[int] = None, *, lang: typing.Optional[str] = None
) -> typing.Sequence[models.ZZZPartialAgent]:
"""Get all owned ZZZ characters."""
data = await self._request_zzz_record("avatar/basic", uid, lang=lang, cache=False)
return [models.ZZZPartialAgent(**item) for item in data["avatar_list"]]

0 comments on commit cc50439

Please sign in to comment.