Equicord/src/equicordplugins/richPresence/native.ts
creations bb6b23fa6c
merge 6 RPC plugins into one plugin (#890)
* merge 6 RPC plugins into one plugin

* Update index.tsx

---------

Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com>
2026-03-07 11:34:41 -05:00

20 lines
691 B
TypeScript

/*
* Vencord, a Discord client mod
* Copyright (c) 2026 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { GrTrackData } from "./types/gensokyoRadio";
export async function fetchTrackData(): Promise<GrTrackData | null> {
const song = await (await fetch("https://gensokyoradio.net/api/station/playing/")).json();
return {
title: song.SONGINFO.TITLE,
album: song.SONGINFO.ALBUM,
artist: song.SONGINFO.ARTIST,
position: song.SONGTIMES.SONGSTART,
duration: song.SONGTIMES.SONGEND,
artwork: song.MISC.ALBUMART ? `https://gensokyoradio.net/images/albums/500/${song.MISC.ALBUMART}` : "",
};
}