diff --git a/disco/types/user.py b/disco/types/user.py index 63e9542..e71b29b 100644 --- a/disco/types/user.py +++ b/disco/types/user.py @@ -1,6 +1,6 @@ from holster.enum import Enum - -from disco.types.base import SlottedModel, Field, snowflake, text, with_equality, with_hash +from datetime import datetime +from disco.types.base import SlottedModel, Field, snowflake, text, with_equality, with_hash, ListField DefaultAvatars = Enum( BLURPLE=0, @@ -69,12 +69,44 @@ Status = Enum( 'OFFLINE', ) +class Party(SlottedModel): + id = Field(text) + size = ListField(int) + +class Assets(SlottedModel): + large_image = Field(text) + large_text = Field(text) + small_image = Field(text) + small_text = Field(text) + +class Secrets(SlottedModel): + join = Field(text) + spectate = Field(text) + match = Field(text) + +class Timestamps(SlottedModel): + start = Field(int) + end = Field(int) + + def start_time(self): + return datetime.utcfromtimestamp(self.start / 1000) + + def end_time(self): + return datetime.utcfromtimestamp(self.end / 1000) class Game(SlottedModel): type = Field(GameType) name = Field(text) url = Field(text) - + timestamps = Field(Timestamps) + application_id = Field(text) + details = Field(text) + state = Field(text) + party = Field(Party) + assets = Field(Assets) + secrets = Field(Secrets) + instance = Field(bool) + flags = Field(int) class Presence(SlottedModel): user = Field(User, alias='user', ignore_dump=['presence'])