Updated Statsfm, Added Game Activity (#162)
Some checks are pending
Sync to Codeberg / Sync Codeberg and Github (push) Waiting to run
Test / Test (push) Waiting to run

(thanks to Vencord's Lastfm plugin)
This commit is contained in:
Crxaw 2025-02-21 12:09:40 +00:00 committed by GitHub
parent 9e50746d02
commit 30a248e2b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,6 +5,7 @@
*/
import { definePluginSettings } from "@api/Settings";
import { getUserSettingLazy } from "@api/UserSettings";
import { EquicordDevs } from "@utils/constants";
import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types";
@ -113,7 +114,7 @@ interface SFMR {
item: Item;
}
const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame")!;
const applicationId = "1325126169179197500";
const placeholderId = "2a96cbd8b46e442fc41c2b86b821562f";
@ -159,6 +160,11 @@ const settings = definePluginSettings({
type: OptionType.BOOLEAN,
default: false,
},
enableGameActivity: {
description: "Enable game activity for Stats.fm", // Credit to LastfmPresence for this setting
type: OptionType.BOOLEAN,
default: false,
},
statusName: {
description: "Custom status text",
type: OptionType.STRING,
@ -264,6 +270,11 @@ export default definePlugin({
}
const trackData = json.item.track;
if (settings.store.enableGameActivity && trackData) {
ShowCurrentGame.updateSetting(true);
} else if (settings.store.enableGameActivity) {
ShowCurrentGame.updateSetting(false);
}
if (!trackData) return null;
return {
name: trackData.name || "Unknown",