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