mirror of
https://github.com/Equicord/Equicord.git
synced 2025-02-23 16:49:24 -05:00
Updated Statsfm, Added Game Activity (#162)
(thanks to Vencord's Lastfm plugin)
This commit is contained in:
parent
9e50746d02
commit
30a248e2b6
1 changed files with 12 additions and 1 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Reference in a new issue