mirror data from lanyard api

This commit is contained in:
Conrad
2021-06-16 23:57:52 -04:00
parent fd3ed61089
commit 8bd4a28ef7
10 changed files with 333 additions and 218 deletions

76
src/LanyardTypes.ts Normal file
View File

@@ -0,0 +1,76 @@
export interface Root {
success: boolean;
data: Data;
}
export interface Data {
spotify: Spotify;
listening_to_spotify: boolean;
discord_user: DiscordUser;
discord_status: string;
activities: Activity[];
active_on_discord_mobile: boolean;
active_on_discord_desktop: boolean;
}
export interface Spotify {
track_id: string;
timestamps: Timestamps;
song: string;
artist: string;
album_art_url: string;
album: string;
}
export interface Timestamps {
start: number;
end: number;
}
export interface DiscordUser {
username: string;
public_flags: number;
id: string;
discriminator: string;
avatar: string;
}
export interface Activity {
type: number;
state: string;
name: string;
id: string;
emoji?: Emoji;
created_at: number;
application_id?: string;
timestamps?: Timestamps2;
sync_id?: string;
session_id?: string;
party?: Party;
flags?: number;
details?: string;
assets?: Assets;
buttons?: string[];
}
export interface Emoji {
name: string;
id: number;
animated: boolean;
}
export interface Timestamps2 {
start: number;
end?: number;
}
export interface Party {
id: string;
}
export interface Assets {
small_text?: string;
small_image?: string;
large_text: string;
large_image: string;
}

8
src/renderCard.ts Normal file
View File

@@ -0,0 +1,8 @@
import * as LanyardTypes from './LanyardTypes';
const renderCard = (data: LanyardTypes.Root): any => {
//create svg, foreign object almost everything lol
console.log(data);
}
export default renderCard;