Skip to content

Commit 3b9ed5c

Browse files
authored
Merge pull request #12 from hexaaagon/main
feat(types): added new types
2 parents 8c6d732 + 6463a11 commit 3b9ed5c

File tree

1 file changed

+34
-13
lines changed

1 file changed

+34
-13
lines changed

src/types.ts

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,34 @@ export interface LanyardError {
5050
code: string;
5151
}
5252

53-
export interface LanyardData {
54-
spotify?: Spotify;
55-
listening_to_spotify: boolean;
53+
export type LanyardData = {
5654
discord_user: DiscordUser;
5755
discord_status: "online" | "idle" | "dnd" | "offline";
58-
kv?: Kv;
56+
kv: Kv;
5957
activities: Activity[];
6058
active_on_discord_web: boolean;
6159
active_on_discord_mobile: boolean;
6260
active_on_discord_desktop: boolean;
63-
}
61+
active_on_discord_embedded: boolean;
62+
} & Spotify
6463

6564
export interface Kv {
6665
[key: string]: string;
6766
}
6867

69-
export interface Spotify {
70-
track_id: string;
71-
timestamps: Timestamps;
72-
song: string;
73-
artist: string;
74-
album_art_url: string;
75-
album: string;
68+
export type Spotify = {
69+
lintening_to_spotify: true,
70+
spotify: {
71+
track_id: string;
72+
timestamps: Timestamps;
73+
song: string;
74+
artist: string;
75+
album_art_url: string;
76+
album: string;
77+
}
78+
} | {
79+
listening_to_spotify: false,
80+
spotify: null
7681
}
7782

7883
export interface Timestamps {
@@ -133,4 +138,20 @@ export interface DiscordUser {
133138
asset: string;
134139
expires_at: number;
135140
} | null;
136-
}
141+
clan: null; // clan object deprecated
142+
primary_guild: {
143+
tag: string;
144+
identity_guild_id: string;
145+
badge: string;
146+
identity_enabled: boolean;
147+
} | null;
148+
collectibles: {
149+
nameplate: {
150+
label: string;
151+
sku_id: string;
152+
asset: string;
153+
expires_at: string | null;
154+
palette: string;
155+
};
156+
} | null;
157+
}

0 commit comments

Comments
 (0)